Commit graph

1725 commits

Author SHA1 Message Date
Adam Stephens 3f8b1d2d26
nixos/lxd-agent: add system path for exec 2023-12-28 14:27:05 -05:00
nikstur c9569af3e0
Merge pull request #271326 from philiptaron/shutdown.target
treewide: depend on `shutdown.target` if `DefaultDependencies=no` in almost every case
2023-12-27 08:33:26 +01:00
Mihai-Drosi Câju 800af4240b nixos/waydroid: Replace requirement for ASHMEM with MEMFD_CREATE
* fixes #250302
* ASHMEM was removed in Linux 5.18 and waydroid can use MEMFD instead.
  MEMFD is enabled by default in 4.18 and later kernels while we
  already require this version for namespace support.
2023-12-24 16:04:20 +02:00
Florian Klink b6cad0fd94
Merge pull request #274220 from flokli/waagent-cleanups
waagent: cleanups
2023-12-19 19:19:40 +02:00
Adam C. Stephens 6b43e4b0bc
Merge pull request #260128 from adamcstephens/lxd/no-restart-agent
nixos/lxd-agent: prevent restarting on change
2023-12-19 08:41:21 -05:00
Florian Klink f1c8d0709b nixos/waagent: provide waagent udev rules in initrd
This should make /dev/disk/azure appear in-initrd too.
2023-12-18 13:18:11 +02:00
Florian Klink 276939e0a1 nixos/waagent: move runtime dependencies to systemd service
The udev rules shell out to chmod, cut and readlink, which are available
for udev rules (see https://github.com/NixOS/nixpkgs/pull/274236).
2023-12-18 13:18:11 +02:00
Peder Bergebakken Sundt 4071c294ac nixos/lxd: convert cfg.package to mkPackageOption
Also fixes the documentation of `virtualisation.lxd.ui.package`, which currently says the package is `pkgs.ui`
2023-12-16 21:30:18 +01:00
Adam Stephens 27064dd722
nixos/lxc: remove with lib 2023-12-04 10:06:54 -05:00
Adam Stephens ccb7b8e309
nixos/lxcfs: remove with lib 2023-12-04 10:06:52 -05:00
Adam Stephens 6765aac154
treewide/lxc: set lxc team as maintainer 2023-12-04 10:06:50 -05:00
Silvan Mosberger 54c8a15650
Merge pull request #271247 from h7x4/treewide-mkpackageoptionmd-to-mkpackageoption
treewide: replace `mkPackageOptionMD` with `mkPackageOption`
2023-12-01 02:09:10 +01:00
Philip Taron 0a226a0639
nixos/qemu: ensure correct ordering w.r.t. shutdown.target 2023-11-30 15:44:36 -08:00
Philip Taron 07004b46ac
nixos/lxd-agent: ensure correct ordering w.r.t. shutdown.target 2023-11-30 15:42:49 -08:00
Franz Pletz 9619439772
Merge pull request #270004 from Stunkymonkey/libvirtd-add-netcat 2023-11-30 21:04:02 +01:00
Franz Pletz 32caf62376
Merge pull request #268887 from jchw-forks/libvirt-nss 2023-11-30 20:48:24 +01:00
h7x4 79d3d59f58
treewide: replace mkPackageOptionMD with mkPackageOption 2023-11-30 19:03:14 +01:00
Maciej Krüger 50bb5d3338
Merge pull request #264929 from adamcstephens/incus/generator 2023-11-30 16:01:35 +01:00
Weijia Wang feeae486de
Merge pull request #261702 from h7x4/replace-mkoption-with-mkpackageoption
treewide: use `mkPackageOption`
2023-11-30 02:49:30 +01:00
Adam Stephens 0fdef67e07
nixos/lxc-container: add adamcstephens as maintainer 2023-11-28 15:14:45 -05:00
Adam Stephens 2cd9619801
nixos/lxc-container: use lxc systemd generator 2023-11-28 15:14:43 -05:00
h7x4 0a37316d6c
treewide: use mkPackageOption
This commit replaces a lot of usages of `mkOption` with the package
type, to be `mkPackageOption`, in order to reduce the amount of code.
2023-11-27 01:28:36 +01:00
Robert Hensing ecef65f019
Merge pull request #269970 from emilylange/nixos-containers-warning
nixos/containers: warn if containers are used but disabled
2023-11-26 19:39:32 +01:00
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
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