Commit Graph

1753 Commits

Author SHA1 Message Date
Mihai-Drosi Câju
be6ac65b52 nixos/waydroid: remove with lib; and friends 2023-11-26 17:13:15 +02:00
Felix Buehler
1b5617e25b nixos/libvirtd: add netcat and support
see: https://github.com/NixOS/nixpkgs/issues/180806
2023-11-25 23:45:18 +01:00
emilylange
1c404d2584
nixos/containers: warn if containers are used but disabled
This is a follow-up to 8dfe8e447e.
2023-11-25 20:01:42 +01:00
con-f-use
5254684a0f nixos/docker: warn about changing storageDriver
Add warning to the documentation of
`virtualisation.docker.storageDriver` that changing will cause any
existing containers and images to become inaccessible.
2023-11-21 16:00:36 +01:00
John Chadwick
412543ddd8 nixos/libvirtd: add support for nss modules 2023-11-21 01:39:02 -05:00
Yang, Bo
6d69feb35e google-compute-image: add the missing /boot filesystem 2023-11-18 13:37:42 +01:00
Yang, Bo
bff548fef1 waagent: enable provisioning 2023-11-14 19:47:27 +01:00
Maciej Krüger
c647a12d7f
Merge pull request #265725 from nbraud/nixos/sudo-rs/gce 2023-11-11 18:09:20 +01:00
Thiago Kenji Okada
da8c62363e
Merge pull request #266310 from Atry/patch-4
azure-agent: add dependencies for its extensions
2023-11-09 09:52:10 +00:00
Yang, Bo
1ce985242c google-compute-image: support NVMe and UEFI 2023-11-08 21:05:21 +01:00
Yang, Bo
c4086e5ce9 azure-agent: add dependencies for its extensions
waagent's extension `Microsoft.OSTCExtensions.VMAccessForLinux` requires Python, otherwise it would be failed to install with the following error message in `/var/log/waagent.log`:

```
No Python interpreter found on the box
```

waagent's extension `Microsoft.CPlat.Core.RunCommandLinux` needs lsof, otherwise it would produce the following error message in `/var/log/waagent.log`:

```
/var/lib/waagent/Microsoft.Azure.Extensions.CustomScript-2.1.10/bin/custom-script-shim: line 60: lsof: command not found
```
2023-11-08 17:54:08 +00:00
Florian Brandes
2ed7a5ab59 nixos/virtualization: fix shellcheck login
fixes https://www.shellcheck.net/wiki/SC2002

Signed-off-by: Florian Brandes <florian.brandes@posteo.de>
2023-11-07 13:40:42 +01:00
Alyssa Ross
8ab2f09522 nixos/qemu-vm: fix infinite recursion
The virtualisation.directBoot.initrd option was added for netboot
images, but the assertion to check directBoot enabled if it was used
caused an infinite recursion if it was.  Minimal reproduction:

	import nixos/tests/make-test-python.nix ({ pkgs, ... }: {
	  name = "";

	  nodes = {
	    machine = { config, ...}: {
	      imports = [ nixos/modules/installer/netboot/netboot-minimal.nix ];

	      virtualisation.directBoot = {
	        enable = true;
	        initrd = "${config.system.build.netbootRamdisk}/${config.system.boot.loader.initrdFile}";
	      };
	    };
	  };
	  testScript = "";
	}) {}

The fix is to swap the two conditions, so that cfg.directBoot.enable
is checked first, and the initrd comparision will be short circuited.

This wasn't noticed during review because in earlier versions of the
virtualisation.directBoot patch, the assertion was accidentally in the
conditional above, so wasn't evaluated unless port forwarding was in
use.
2023-11-06 13:49:31 +01:00
nicoo
89fd59c12a nixos/vagrant-guest: Set security.sudo-rs.wheelNeedsPassword too 2023-11-06 12:39:04 +01:00
adisbladis
a1592fb410
Merge pull request #258299 from Arcayr/virtualisation-hostname
nixos/virtualisation: add hostname option to oci-containers.
2023-11-06 10:44:26 +13:00
nicoo
326904b128 nixos/google-compute-config: Add sudo-rs rules 2023-11-05 20:33:19 +00:00
Lily Foster
5c5d730067
Merge pull request #262347 from adamcstephens/incus/module
nixos/incus: init module and tests
2023-11-03 09:42:24 -04:00
Adam Stephens
3132ba6cda
nixos/incus: shutdown instances on service stop 2023-11-02 19:54:11 -04:00
Adam Stephens
3087595a6b
nixos/incus: preseed should not trigger socket-activation 2023-11-02 19:54:04 -04:00
Adam Stephens
1fff6a9031
nixos/incus: init module and tests 2023-11-02 19:54:02 -04:00
Franz Pletz
265ca81834
Merge pull request #241908 from picnoir/nin/oci-container-pre-start-list 2023-10-31 15:53:35 +01:00
K900
6f06066e94 nixos/containers: use latest stateVersion as example
Hopefully this way we don't confuse people into thinking you have to set it to 21.05.
2023-10-27 12:56:12 +03:00
Albert Peschar
6ed6953e22 nixos/oci-containers: stop container using backend
Make systemd actually call `podman stop` when stopping a container unit.

Fixes #249332
2023-10-26 12:52:59 +00:00
Robert Hensing
5dfc78a8ad
Merge pull request #262021 from Enzime/linux-builder-cross
linux-builder: support `x86_64-linux` on `aarch64`
2023-10-24 14:34:29 +02:00
Michael Hoang
ab1f45f3d3 linux-builder: support x86_64-linux on aarch64 2023-10-24 13:35:37 +02:00
Maciej Krüger
1ecbbb6e3f
Merge pull request #260595 from adamcstephens/lxc/squashfs
lxc-container: add squashfs image support and release output
2023-10-24 02:06:36 +02:00
Ryan Lahfa
b9337215cd
Merge pull request #229035 from NixOS/qemu-vm/tpm
qemu-vm: support TPM usecases
2023-10-23 10:10:27 +01:00
Arthur Gautier
08f4fe2087 qemu-vm: stop the swtpm once qemu stops
The idea is to run an async process waiting for swtpm
and we have to ensure that `FD_CLOEXEC` is cleared on this process'
stdin file descriptor, we use `fdflags` for this, a loadable builtin in
Bash ≥ 5.

The async process when exited will terminate `swtpm`, we bind the
termination of the async process to the termination of QEMU by virtue of
having `qemu` exec in that Bash script.

Signed-off-by: Arthur Gautier <baloo@superbaloo.net>
Co-authored-by: Raito Bezarius <masterancpp@gmail.com>
2023-10-23 01:02:24 +02:00
Raito Bezarius
25872524f0 nixos/qemu-vm: add virtualisation.tpm for running TPM in QEMU infrastructure 2023-10-22 16:01:37 +02:00
Maciej Krüger
49bc1a76e0
Merge pull request #261692 from josephst/fix-lxc-container-bootloader
nixos/lxc-container: use absolute path for ln in install-lxc-sbin-init.sh
2023-10-22 13:47:14 +02:00
grindhold
108a6f181a nixos/containers: check nixos-container names for underscores 2023-10-22 09:45:41 +02:00
Joseph Stahl
d156ab6c9c nixos/lxc-container: use absolute path for ln in install-lxc-sbin-init.sh
Recent change to nixos-rebuild (https://github.com/NixOS/nixpkgs/pull/258571)
adds systemd-run, which brings with it a cleaner environment
(ie $PATH not available).
Workaround: use absolute path for ln to avoid command-not-found error
2023-10-22 03:18:15 +03:00
Robert Hensing
7096340f9e nixos/qemu-vm: Rename nixos-disk-image -> nix-store-image
For the image that's actually a store image only.
Helps with visibility. The name "nixos-disk-image" has no special
significance, by grepping nixpkgs.
2023-10-21 19:13:58 +02:00
Lin Jian
fbc62319f1
Merge pull request #260291 from donovanglover/nixos-containers/optional-restart
nixos/nixos-containers: add restartIfChanged option
2023-10-16 20:41:32 +08:00
Maciej Krüger
afc33ef9d2
Merge pull request #260687 from mkg20001/lxd-ui
nixos/lxd: fix ui.enable desc
2023-10-16 01:30:58 +02:00
Adam Stephens
dbeeeb8e06
nixos/lxc-container: enable udev-trigger for nested containers 2023-10-12 15:11:09 -04:00
Adam Stephens
c2ff509e66
lxc-container: add squashfs image support and release output 2023-10-12 10:52:05 -04:00
Maciej Krüger
d934d20cd3
nixos/lxd: fix ui.enable desc
Otherwise it would show up as "Whether to enable Enables the (experimental) LXD UI. ."

Now is just "Whether to enable (experimental) LXD UI."
2023-10-12 15:24:01 +02:00
Donovan Glover
fd7daf9fc4
nixos/nixos-containers: add restartIfChanged option
This commit makes auto-restarting declarative containers optional.

This is useful when you don't want changes to your config to automatically
restart the container and thus stop any applications running inside it.
2023-10-11 21:53:42 -04:00
Adam Stephens
eb221a898f
nixos/lxd-agent: prevent restarting on change 2023-10-09 23:54:53 -04:00
Sarah Brofeldt
a655e7a1aa
Merge pull request #259240 from haenoe/oci-containers-labels-option
nixos/oci-containers: add labels option
2023-10-09 18:52:20 +02:00
HaeNoe
2f021def6e nixos/oci-containers: add labels option 2023-10-09 10:43:29 +02:00
ners
dccd00027e
nixos/azure: add contents module option (#244364) 2023-10-08 19:35:14 +02:00
nikstur
62e95d095d nixos/qemu-vm: optionally disable overriding fileSystems
Allow the user to disable overriding the fileSystems option with
virtualisation.fileSystems by setting
`virtualisation.fileSystems = lib.mkForce { };`.

With this change you can use the qemu-vm module to boot from an external
image that was not produced by the qemu-vm module itself. The user can
now re-use the modularly set fileSystems option instead of having to
reproduce it in virtualisation.fileSystems.
2023-10-02 11:13:26 +02:00
K900
e53c99eb17 treewide: use pkgs.config instead of config.nixpkgs.config
`pkgs` may be passed in externally, in which case `config.nixpkgs.config` will not be set.

Follow-up to #257458.
2023-10-01 20:48:40 +03:00
Elliot Speck (Arcayr)
3782b3b5d9 nixos/virtualisation: add hostname option to oci-containers. 2023-10-01 05:17:44 +11:00
Thiago Kenji Okada
e514178339 nixos/virtualisation: use mkDefault in networking.useNetworkd in oci-common
To make it easier to disable for those folks who don't want to use
systemd-networkd.
2023-09-28 22:05:34 +01:00
Adam Stephens
b1237da5b2
systemd: revert allow udev-trigger for lxd nested containers 2023-09-28 13:58:11 -04:00
Mario Rodas
25b9f4d2b6
Merge pull request #255116 from adamcstephens/lxd/udev-container
systemd: allow udev-trigger to run on lxd containers with nesting
2023-09-28 02:17:27 -05:00
Thiago Kenji Okada
d5d4b08488 nixos/virtualisation: always use EFI for OCI 2023-09-21 22:57:39 +01:00
Thiago Kenji Okada
cd67657ae2 nixos/virtualisation: use systemd-networkd for OCI 2023-09-21 22:57:39 +01:00
Thiago Kenji Okada
5eae6db9e3 nixos/virtualisation: remove deprecated option from OCI common 2023-09-21 22:57:39 +01:00
Samuel Dionne-Riel
2eb41eb208 nixos/virtualization: Allow building EFI / A1 OCI images
A couple notes:
---------------

Adding invalid `console=` parameters is not an issue. Any invalid
console is unused. The kernel will use the "rightmost" (last) valid
`console=` parameter as the default output. Thus the SBBR-mandated AMA0
on A1, and ttyS0 on x86_64 as documented by Oracle.

`nvme_core.shutdown_timeout=10` was added as it was written this way in
the A1 images. Unclear whether `nvme.shutdown_timeout=10` is wrong. At
worst this is a no-op.
2023-09-21 22:57:38 +01:00
Samuel Dionne-Riel
d944fb4a19 nixos/virtualization: Allow building EFI OCI images 2023-09-21 22:57:38 +01:00
Samuel Dionne-Riel
9849ccb241 nixos: Add OCI image options
Follows what amazon images does.
2023-09-21 22:57:38 +01:00
Samuel Dionne-Riel
3a35abf169 nixos/oci-image: Minor cleanup 2023-09-21 22:15:22 +01:00
ilian
362d1d6218 oci-image: init scripts to build and upload image
Add image configuration for Oracle Cloud Infrastructure and scripts to
build and upload the image as a Custom Image.
2023-09-21 22:15:22 +01:00
louib
66100e22f6 nixos/virtualisation: allow configuring openssh root login on GCE
This commit makes the OpenSSH option `PermitRootLogin` available to be
configured by other NixOS modules when using the Google Cloud Engine
(GCE) NixOS image builder. Other options like `PasswordAuthentication`
were already configurable, so I think it makes sense to make `PermitRootLogin`
configurable as well is order to disable it completely, for example.
2023-09-16 19:43:02 -04:00
Valentin Gagarin
295a5e1e2b
fix capitalization (#254542) 2023-09-15 09:59:11 +02:00
Adam Stephens
8565cd862a
systemd: allow udev-trigger to run on lxd containers with nesting 2023-09-14 09:17:33 -04:00
Michele Guerini Rocco
704c791a90
Merge pull request #253146 from rnhmjoj/pr-anbox
anbox: unbreak
2023-09-05 23:46:54 +02:00
Adam Stephens
a90385c62b nixos/lxd: add preseed option 2023-09-05 15:28:00 +00:00
Adam Stephens
85c14ff2ff nixos/lxd: remove with lib 2023-09-05 15:28:00 +00:00
Samuel Dionne-Riel
7425d9254d
nixos/anbox: use --daemon to squash warning
As noted in https://github.com/NixOS/nixpkgs/pull/102341 this is not
actually running as a forked process. It only tells the process that it
is running "as a daemon, so shut the warning up".

See `daemon_` here

 - 9de4e87cdd/src/anbox/cmds/container_manager.cpp (L38-L79)

It is **strictly** used to hide that message.

Co-authored-by: Matt Votava <mvnetbiz@gmail.com>
2023-09-05 10:09:44 +02:00
Samuel Dionne-Riel
7fa154f3ee
nixos/anbox: allow applying changes to the image 2023-09-05 10:09:43 +02:00
Samuel Dionne-Riel
cdc51c811a
nixos/anbox: handle new kernel configurations 2023-09-05 10:09:43 +02:00
Samuel Dionne-Riel
708e1eb8ba
nixos/anbox: mark anbox0 as unmanaged with NetworkManager 2023-09-05 10:09:42 +02:00
Adam Stephens
efd1605be6
nixos/lxd: add virtual-machine support, image and module 2023-09-03 20:06:44 -04:00
github-actions[bot]
4a9909e0db
Merge master into staging-next 2023-08-19 00:01:42 +00:00
Adam Stephens
1403486d17 nixos/lxd-agent: init module from distrobuilder generator 2023-08-18 22:28:59 +00:00
James Baker
09d32e2612
nixos/virtualisation.docker: Do not assert 32 bit libraries available on ARM (#246179) 2023-08-11 10:49:25 +02:00
Franz Pletz
dcafb07ed8
Merge pull request #232250 from YBeaugnon/libvirt-hooks
nixos/libvirtd: hooks support
2023-08-09 15:07:52 +02:00
Jake Schurch
36430fbb14 revert(proxmox-image): pull request #246120 from jakeschurch/add-proxmox-image-addl-disk-size-override
NOTES:

@jakeschurch did not realize that is was already updated on master, but not
backported to 23.05 channel

Signed-off-by: Jake Schurch <jakeschurch@gmail.com>
2023-08-02 15:01:44 -04:00
Pol Dellaiera
71e3934d82
Merge pull request #246120 from jakeschurch/add-proxmox-image-addl-disk-size-override
proxmox-image: add additionalDiskSpace parameter as input to make-disk-image.nix
2023-07-30 20:34:00 +02:00
Jake Schurch
a479735162 respond to pr feedback
Signed-off-by: Jake Schurch <jakeschurch@gmail.com>
2023-07-30 12:01:03 -04:00
Jake Schurch
d780bdf308
Update nixos/modules/virtualisation/proxmox-image.nix
Co-authored-by: Pol Dellaiera <pol.dellaiera@protonmail.com>
2023-07-30 11:57:29 -04:00
Jake Schurch
f2794786fd proxmox-image: add additionalDiskSpace parameter as input to make-disk-image.nix 2023-07-29 20:47:46 -04:00
Emily
49c07cd259
Merge pull request #238735 from MayNiklas/proxmox-image-settings
nixos/proxmox-image: add additionalSpace, bootSize and diskSize options
2023-07-27 22:17:42 +02:00
Pol Dellaiera
d242834675
Merge pull request #230109 from vdot0x23/docker-extraPackages
nixos/docker: add extraPackages option
2023-07-26 15:14:13 +02:00
Sandro
9f4a3203eb
Merge pull request #233250 from SuperSandro2000/podman-timer-persist 2023-07-21 11:34:18 +02:00
Jon Seager
5e73f0c1c9 nixos/lxd: fix default ui package 2023-07-17 08:04:42 -03:00
Sandro
75cfb4925a
Merge pull request #242126 from kjeremy/vmware-guest-aarch64
vmware-guest module: work under aarch64
2023-07-14 19:51:14 +02:00
Ryan Lahfa
49413e25e0
Merge pull request #241314 from jnsgruk/master 2023-07-08 13:58:20 +02:00
Jeremy Kolb
1e16a937ca vmware-guest module: work under aarch64 2023-07-07 15:40:29 -04:00
Jon Seager
2fbb85e2c9
nixos/lxd: add ui.enable option to toggle ui feature 2023-07-07 18:31:03 +01:00
Félix Baylac Jacqué
b7fd022677 nixos/oci-containers: make systemd service pre-start extensible
We were setting the systemd pre-start script through the
systemd.services.<name>.preStart NixOS option. This option uses a
string containing the pre-start script as input.

In some scenarios, you want to extend this script to perform some
additional actions before launching a container.

At the moment, your only option is to mkForce the pre-start string and
rewrite a preStart script from scratch. Potentially vendoring the
Nixpkgs pre-start script in your custom pre-start script. (you can
also create a new service unit in charge of running the custom
pre-start and create a dependency link between the units, but that's
also sub-optimal).

The systemd.services.<name>.serviceConfig.ExecStartPre NixOS option
gives us a better way to extend a pre-start script. Instead of being a
simple script, this option can be a list of scripts. The NixOS module
system then merges the multiple list declarations instead of
overriding them. Meaning that if we use this ExecStartPre option, we
can trivially extend the exec-start script: just add the custom script
in the systemd service override and you're done.

ExecStartPre behaves a tiny bit differently from preStart. Instead of
expecting a string containing a script, it expects a path pointing to
a script. We take advantage of this API change to check the pre-start
script with shellCheck via the pkgs.writeShellApplication function.
2023-07-06 13:35:31 +02:00
Michael Hoang
98d970bc37 nixos/qemu-vm: use CA certificates from host 2023-07-06 21:32:08 +10:00
Sandro Jäckel
2048a8ca02
nixos/proxmox-image: fix example rendering 2023-06-30 18:14:43 +02:00
Atemu
a04b45f10e
Merge pull request #238596 from nikstur/qemu-vm-use-host-pkgs
nixos/qemu-vm: use cfg.host.pkgs
2023-06-26 09:06:31 +02:00
Felix Buehler
6672dde558 treewide: use optionalAttrs instead of 'else {}' 2023-06-25 11:01:34 -03:00
nikstur
f6b37ddaf2 nixos/qemu-vm: use cfg.host.pkgs 2023-06-24 00:45:15 +02:00
Martino Fontana
e1a6c85c2b nixos/sysctl: raise default vm.max_map_count to 1048576 2023-06-21 19:25:42 +02:00
MayNiklas
d7f89bbfb6 nixos/proxmox-image: add additionalSpace, bootSize and diskSize options 2023-06-21 14:13:03 +02:00
nikstur
0bdba6c99b nixos/qemu-vm: use persistent block device names
This change removes the bespoke logic around identifying block devices.
Instead of trying to find the right device by iterating over
`qemu.drives` and guessing the right partition number (e.g.
/dev/vda{1,2}), devices are now identified by persistent names provided
by udev in /dev/disk/by-*.

Before this change, the root device was formatted on demand in the
initrd. However, this makes it impossible to use filesystem identifiers
to identify devices. Now, the formatting step is performed before the VM
is started. Because some tests, however, rely on this behaviour, a
utility function to replace this behaviour in added in
/nixos/tests/common/auto-format-root-device.nix.

Devices that contain neither a partition table nor a filesystem are
identified by their hardware serial number which is injecetd via QEMU
(and is thus persistent and predictable). PCI paths are not a reliably
way to identify devices because their availability and numbering depends
on the QEMU machine type.

This change makes the module more robust against changes in QEMU and the
kernel (non-persistent device naming) and by decoupling abstractions
(i.e. rootDevice, bootPartition, and bootLoaderDevice) enables further
improvement down the line.
2023-06-16 19:36:03 +02:00
Raito Bezarius
610f60231f nixos/qemu-vm: introduce virtualisation.directBoot
As with many things, we have scenarios where we don't want to boot on a
disk / bootloader and also we don't want to boot directly.

Sometimes, we want to boot through an OptionROM of our NIC, e.g. netboot
scenarios or let the firmware decide something, e.g. UEFI PXE (or even
UEFI OptionROM!).

This is composed of:

- `directBoot.enable`: whether to direct boot or not
- `directBoot.initrd`: enable overriding the
  `config.system.build.initialRamdisk` defaults, useful for
  netbootRamdisk for example.

This makes it possible.
2023-06-09 14:51:18 +02:00
K900
57e1ea5a18 nixos/libvirtd: don't use cp -n 2023-06-05 19:14:01 +03:00
Victor Buttner
4f1ccb7fc5 nixos/docker: add extraPackages option
This permits easier use of some features, e.g. docker checkpoint.
2023-06-02 15:45:55 +02:00
Ryan Lahfa
0902958046
Merge pull request #235295 from nikstur/qemu-vm-improve-comments-and-docs
nixos/qemu-vm: improve comments and option descriptions
2023-06-02 15:34:49 +02:00
Amine Chikhaoui
709043ed97
add release 23.05 AWS AMIs 2023-06-01 13:46:53 -04:00
nikstur
003fec835c nixos/qemu-vm: remove grub references from useBootLoader description 2023-06-01 01:38:08 +02:00
nikstur
8ea8154a32 nixos/qemu-vm: (re-)move old/incorrect comments 2023-06-01 01:38:06 +02:00
Raito Bezarius
09d1022782 nixos/qemu-vm: fix 32-bits assert for memorySize
It should be an implication, rather than &&.
2023-05-27 17:20:08 +02:00
Ryan Lahfa
537c6ede55
Merge pull request #234266 from emilylange/qemu-vm-2047mb
nixos/qemu-vm: add `virtualisation.memorySize < 2048` assertion on 32bit
2023-05-27 15:31:00 +02:00
emilylange
5dbd4f3243
nixos/qemu-vm: add virtualisation.memorySize < 2048 assertion on 32bit 2023-05-26 19:43:58 +02:00
Ryan Lahfa
435237d641
Merge pull request #233350 from GrahamDennis/grahamdennis/testing-networks
nixos/qemu-vm: add option for named network interfaces
2023-05-26 15:57:01 +02:00
lucasew
8587646ef3 nixos/virtualisation/google-compute-config: minor refactoring
Signed-off-by: lucasew <lucas59356@gmail.com>
2023-05-26 00:56:32 +00:00
illustris
6a20c13258
nixos/proxmox-image: fix qemu build failure 2023-05-25 16:25:43 +05:30
Graham Dennis
93502aa3b1 nixos/qemu-vm: add option for named network interfaces
Adds a new option to the virtualisation modules that enables specifying explicitly named network interfaces in QEMU VMs.
The existing `virtualisation.vlans` option is still supported for cases where the name of the network interface is irrelevant.
2023-05-24 08:54:20 +10:00
Sandro Jäckel
9ad0793b40
nixos/podman: persist timer
otherwise the timer might never run on laptops which could be shutdown
during the night
2023-05-21 17:24:16 +02:00
Sandro Jäckel
64361e26b2
nixos/libvirtd: enable polkit
it is enforced by an assert anyway
2023-05-20 17:30:34 +02:00
Yoann Beaugnon
9617d41ab1 nixos/libvirtd: add support for nixos managed libvirt hooks
Libvirt support calling user defined hooks on certains events.
Documentation can be found https://libvirt.org/hooks.html.
This commit allow specifying these hooks via the
virtualisation.libvirtd.hooks.<name>.* options
2023-05-19 12:46:07 +02:00
Maciej Krüger
5bb24e21ee
Merge pull request #231097 from aanderse/lxc/nixos-rebuild-boot 2023-05-16 04:13:01 +02:00
Fabian Möller
c51fe112cc
treewide: pass system argument to eval-config.nix
Calling `eval-config.nix` without a `system` from a Nix flake fails with
`error: attribute 'currentSystem' missing` since #230523. Setting
`system = null` removes the use of `currentSystem` and instead uses the
value from the `nixpkgs` module.
2023-05-12 14:56:23 +02:00
Arian van Putten
6c0935d466
Merge pull request #231140 from NixOS/rosetta-nix-build
modules/rosetta: configure nix build sandbox to use rosetta
2023-05-11 14:21:54 -04:00
ajs124
30bea8d82d nixos/*: remove boot.grub.version 2023-05-10 21:51:26 +02:00
Arian van Putten
a33d032939 modules/rosetta: configure nix build sandbox to use rosetta
With this we can do x86_64 builds on aarch64
2023-05-10 14:28:50 -04:00
Aaron Andersen
dd2c3b1310 nixos/lxc-container: ensure /sbin/init is updated on nixos-rebuild boot 2023-05-10 11:04:07 -04:00
Ryan Lahfa
98167d573d
Merge pull request #229313 from mped-oticon/mped_proxmox_assert
nixos/proxmox-image: Disable O_DIRECT to fix assert when writing to tmpfs
2023-05-08 16:11:40 +02:00
Mark Ruvald Pedersen
66fb2f539a nixos/proxmox-image: Disable O_DIRECT to fix assert
Context summary:
'vma create' can't otherwise write to tmpfs such as /dev/shm.
This is important when used from non-nixos machines which may
have /build as tmpfs.

VMA is Proxmox's virtual machine image format that wraps QEMU images,
augmenting these with proxmox-specific configuration file.
proxmox-image.nix uses the VMA tool to create vma image files.
The VMA tool exists as a patchset ontop of QEMU.

VMA writes its output with open() and O_DIRECT flag.
O_DIRECT does not work on Linux tmpfs [1]. Thus:
$ vma create ~/output.vma ...  # works, assuming home isn't tmpfs.
$ vma create /dev/shm/output.vma ...  # fails since /dev/shm is tmpfs
Failure results in assert(*errp == NULL).

O_DIRECT is a cache performance hint.
But it currently blocks our usage of nixos-generate -f proxmox from
Non-NixOS hosts and Docker.

The patch here simply removes O_DIRECT:
vma-writer.c later performs memalign due to O_DIRECT, but this is
safe to do with or without O_DIRECT.
Ideally, this should be fixed in upstream Proxmox: Perhaps by falling
back to open without O_DIRECT.

Another attempt to fix this SIGABRT is [2], which writes the vma file
directory to $out/ folder -- however that may still be tmpfs mounted
which it is in our case.

[1] https://lore.kernel.org/lkml/45A29EC2.8020502@tmr.com/t/
[2] https://github.com/NixOS/nixpkgs/pull/224282
2023-05-08 12:33:41 +02:00
Vladimír Čunát
5674901601
Revert "nixos/qemu-vm: fix diskless VMs" 2023-05-06 21:41:14 +02:00
Ryan Lahfa
1ab4d7d0c3
Merge pull request #228047 from RaitoBezarius/diskless-vm
nixos/qemu-vm: fix diskless VMs
2023-05-05 15:37:11 +02:00
Peter Kling
996db6d059
virtualisation/qemu-vm: escape bash variable in shell script
Fixes #229729
2023-05-04 09:52:49 +02:00
Raito Bezarius
6e8248c8b2 nixos/qemu-vm: make it possible to use UEFI without bootloaders
`useEFIBoot` is somewhat misleading, but we should make it possible to
enable UEFI environment / firmware without buying into a bootloader.

This makes it possible.
2023-05-02 23:20:03 +02:00
Raito Bezarius
be4e7ef905 nixos/qemu-vm: fix diskless VMs
Previously, it was possible to run with a tmpfs / with
`virtualisation.diskImage = null;`, this was likely broken by my changes
in 4b4e4c3ef9.

It is reintroduced by disabling properly the bootloader for now, as it
is complicated to make it work with.
2023-04-25 02:12:26 +02:00
Raito Bezarius
0df5257b82 nixos/qemu-vm: introduce virtualisation.mountHostNixStore option
Now that `useBootLoader` produces a full system image, moving disk
images can be slow because they have a full Nix store in them.

It does not make sense to keep the 9p mountpoint to shadow the
/nix/store of the VM.

We disable it if we have `useBootLoader` and introduce an option for
easy overrides.
2023-04-23 23:58:46 +02:00
Florian Klink
6b27ed3229
Merge pull request #169116 from ElvishJerricco/systemd-stage-1-networkd
Systemd stage 1 networkd
2023-04-21 18:40:59 +02:00
Raito Bezarius
614b83a328 nixos/virtualisation/qemu-vm: remove persistBootDevice option
This option has been introduced in 678eed323f without realizing there was this
PR inflight, unfortunately, it collide with what this PR does and make
it irrelevant.

Therefore, I remove it here.
2023-04-21 13:00:19 +02:00
Raito Bezarius
76c7b656bf nixos/qemu-vm: refactor bootDisk generation using make-disk-image 2023-04-21 13:00:18 +02:00
Weijia Wang
e2d6255e9e
Merge pull request #226882 from wegank/parallels-guests-final
systemd.services.prlshprint: fix type
2023-04-21 10:37:11 +03:00
Artturi
b83db86a9e
Merge pull request #222080 from Stunkymonkey/nixos-optionalString 2023-04-20 16:07:30 +03:00
Ryan Lahfa
645bc49f34
Merge pull request #225981 from jnsgruk/multipass-wait-online
multipass: don't start until online
2023-04-19 18:04:47 +02:00
Weijia Wang
8eb15c5320 systemd.services.prlshprint: fix type 2023-04-18 18:55:47 +03:00
Sandro
893f073fe1
Merge pull request #224171 from alan-strohm/master
nixos/proxmox-image: don't assume virtio0 is using local-lvm storage
2023-04-16 03:30:46 +02:00
adisbladis
4ab1021a1b
Merge pull request #213036 from SuperSandro2000/cri-o/update_storagedrivers
nixos/cri-o: add aufs, devmapper, and zfs to storageDrivers
2023-04-15 16:27:50 +12:00
Calum MacRae
7d03f1aa9f
nixos/cri-o: add aufs, devmapper, and zfs to storageDrivers
Update the storageDrivers option to align with the supported drivers, as listed here:
https://github.com/containers/storage/blob/master/docs/containers-storage.conf.5.md#storage-table
2023-04-15 01:15:46 +02:00
Jon Seager
0dfc5c14d7
nixos/multipass: don't start until online 2023-04-14 11:27:57 +01:00
Sandro
603320b64f
Merge pull request #204534 from SuperSandro2000/boot-tmp 2023-04-12 21:37:47 +02:00
Will Fancher
fef26d88e2 systemd-initrd: Support secrets when boot loader doesn't
initrd-secrets: Fix service config with systemd-stage-1
2023-04-11 15:20:47 -04:00
Felix Buehler
327b0cff7a treewide: use more lib.optionalString 2023-04-07 13:38:33 +02:00
Alan Strohm
121fddc901 nixos/proxmox-image: don't assume virtio0 is using local-lvm storage 2023-03-31 18:42:01 -07:00
David Houston
6e8c2760ac
maintainers: Update houstdav000 -> cyntheticfox 2023-03-30 18:50:29 -04:00
Sandro Jäckel
056be64f11 nixos/podman: add example to enable network dns 2023-03-27 08:42:29 +10:00
Sandro
6f558d3009
Merge pull request #212599 from SuperSandro2000/podman-cleanup 2023-03-27 00:05:30 +02:00
Sandro Jäckel
a5d95ac5fc
nixos/tmp: move /tmp options under boot.tmp 2023-03-19 18:49:37 +01:00
Vladimír Čunát
a86610144f
Merge #219444: staging-next 2023-03-04 2023-03-15 17:35:39 +01:00
Sandro
83dcadaf61
Merge pull request #218482 from illustris/ec2-metadata
nixos/ec2: don't populate nonexistent metadata files
2023-03-15 16:53:40 +01:00
Martin Weinelt
d03d74aa67
Merge remote-tracking branch 'origin/master' into staging-next
Conflicts:
- pkgs/development/python-modules/aiopulse/default.nix
- pkgs/development/python-modules/identify/default.nix
- pkgs/development/python-modules/spur/default.nix
2023-03-12 23:28:23 +01:00
Guillaume Girol
db901673ea
Merge pull request #209156 from pwaller/issue-114594
nixos/grub: Name initrd-secrets by system, not by initrd
2023-03-12 18:50:33 +00:00
github-actions[bot]
98d00577f6
Merge master into staging-next 2023-03-09 06:01:01 +00:00
Will Fancher
46089f7efe
Merge pull request #217886 from lilyinstarlight/fix/qemu-vm-initrd-mkdir-0755
nixos/qemu-vm: fix minor typo
2023-03-08 19:17:28 -05:00