Commit graph

2087 commits

Author SHA1 Message Date
Adam C. Stephens cbe221c56a
nixos/incus: seabios is x86_64 only 2024-12-20 19:18:09 +00:00
Adam C. Stephens d441bda392
incus: refactor tests and fix VM CSM support (#365778) 2024-12-19 19:55:14 -05:00
Adam C. Stephens 6cd3dd3c64
incus: fix CSM support 2024-12-18 23:45:33 -05:00
Sandro 5f88672973
nixos/podman: add systemd to extraPackages (#362372) 2024-12-18 22:48:34 +01:00
phaer 48ec455ae8 virtualisation/disk-image: init
New module to support qemu, qemu-efi, raw, raw-efi outputs as known
from nixos-generators in system.build.images.
2024-12-16 15:35:22 +01:00
Arthur Gautier b82554d2a4 qemu-vm: implement virtualization.tpm.provisioning
This option allows for TPM to provisionned before the control is handed
over to the qemu VM.

This is useful to add EK certificates.

The socket has been split in two, a server socket as well as the control
socket for compatibility with the tpm2-tss swtpm TCTI.

Because the control socket may now be used for provisioning, the swtpm
does not terminate when a client disconnects, and the stop of the swtpm
daemon is now controlled by a call to `swtpm_ioctl`.
2024-12-12 09:00:31 -08:00
Yethal 91bb1c6d75
oci-containers: consolidate capabilities interface (#363574)
* oci-containers: consolidate capabilities interface

* Update nixos/modules/virtualisation/oci-containers.nix

Improved wording

Co-authored-by: Benjamin Staffin <benley@zoiks.net>

---------

Co-authored-by: Benjamin Staffin <benley@zoiks.net>
2024-12-12 11:50:13 -05:00
Jeremy Kolb 7d4abac4b5
vmware-guest: Don't use lib directly for maintainers 2024-12-12 10:35:08 -05:00
Florian Klink 4e7a971fe4
nixos/waagent: init module (#362101) 2024-12-12 14:11:39 +02:00
Silvan Mosberger 4f0dadbf38 treewide: format all inactive Nix files
After final improvements to the official formatter implementation,
this commit now performs the first treewide reformat of Nix files using it.
This is part of the implementation of RFC 166.

Only "inactive" files are reformatted, meaning only files that
aren't being touched by any PR with activity in the past 2 months.
This is to avoid conflicts for PRs that might soon be merged.
Later we can do a full treewide reformat to get the rest,
which should not cause as many conflicts.

A CI check has already been running for some time to ensure that new and
already-formatted files are formatted, so the files being reformatted here
should also stay formatted.

This commit was automatically created and can be verified using

    nix-build a08b3a4d19.tar.gz \
      --argstr baseRev b32a094368
    result/bin/apply-formatting $NIXPKGS_PATH
2024-12-10 20:26:33 +01:00
Illia Ostapyshyn 43300fe72a
nixos/qemu-vm: set permissions for tmpfs root
World-writable fs root breaks ssh key authentication (and likely other
programs).
2024-12-09 16:44:16 +01:00
Arne Keller 6137b22220
nixos/qemu-vm: minor readability improvements (#339681) 2024-12-09 06:35:00 +01:00
codgician d07d8a5589
waagent: improve code readability and doc 2024-12-08 11:05:57 +08:00
codgician 0d7c515332
waagent: init module 2024-12-06 23:32:16 +08:00
Nikita Pedorich 77e81fd860
nixos/podman: add systemd to extraPackages 2024-12-06 19:48:00 +09:00
Yethal 04bf3d8774
nixos/modules/virtualisation: additional configuration options (#349537)
oci-containers: additional configuration options
2024-12-05 12:48:41 -05:00
Sefa Eyeoglu d2f5c28d0d
containerd: 1.7.23 -> 2.0.0 (#356618) 2024-12-02 17:19:46 +01:00
Adam C. Stephens 9ab59bb5fb
incus: format 2024-11-30 00:04:54 -05:00
phaer 91d74082c4 virtualisation/proxmox-lxc: use system.build.image 2024-11-29 17:13:54 +01:00
phaer 06ad3811a8 virtualisation/lxc-container: use system.build.image 2024-11-29 17:13:52 +01:00
phaer f3563c996e virtualisation/azure-image: use system.build.image 2024-11-29 17:12:27 +01:00
phaer 77fce1dc58 virtualisation/digital-ocean: use system.build.image 2024-11-29 17:12:26 +01:00
phaer 41db5209c7 virtualisation/google-compute: use system.build.image 2024-11-29 17:12:26 +01:00
phaer a230d5228d virtualisation/hyperv-image: hyperv.vmFileName -> image.fileName 2024-11-29 17:12:26 +01:00
phaer 6d50a8c57f virtualisation/kubevirt: use system.build.image 2024-11-29 17:12:26 +01:00
phaer d8410d8366 virtualisation/oci-image: use system.build.image 2024-11-29 17:12:26 +01:00
phaer a0ce661c99 virtualisation/proxmox-image: use system.build.image 2024-11-29 17:12:26 +01:00
phaer 342a5021df virtualisation/vagrant-virtualbox: use system.build.image 2024-11-29 17:12:26 +01:00
phaer 6cc7449e30 virtualisation/virtualbox: virtualbox.vmFileName -> image.fileName 2024-11-29 17:12:26 +01:00
phaer b0b3a75676 virtualisation/vmware-image: vmware.vmFileName -> image.fileName 2024-11-29 17:12:26 +01:00
phaer 47c83cb438 virtualisation/linode-image: Use system.build.image 2024-11-29 17:12:26 +01:00
phaer 40142caad0 format files with nixfmt 2024-11-29 17:12:26 +01:00
Adam C. Stephens 6de1312a38
nixos/lxc/container: fix useDhcp with veth (#358806) 2024-11-29 10:45:09 -05:00
Adam C. Stephens f50a1bd99d
nixos/lxc/container: fix useDhcp with veth
https://github.com/NixOS/nixpkgs/pull/347283 changed the default to
exclude non-physical network Kind, but that unfortunately also includes
`veth` which LXC uses for its network interfaces. Re-enable that
functionality so users can use networkd with useDHCP.
2024-11-29 10:37:14 -05:00
Franz Pletz c6369bb94a
nixos-containers: fix enableTun option (#357276) 2024-11-23 17:18:57 +01:00
Franz Pletz c1fb3d817b
nixos/virtualisation: fix rendering of example in diskSize (#355944) 2024-11-23 17:06:13 +01:00
seth 328ebf2094
nixos/containerd: load after local-fs.target & dbus.service
18e4ea9a6c
2024-11-22 14:11:36 -05:00
Paul Grandperrin 853d34898d
nixos-containers: fix enableTun option
When using private users, `mknod /dev/net/tun` is run from the guest and therefor needs the `m` modifier.
2024-11-19 14:43:02 +01:00
Sandro 12afb73784
nixos/virtualisation: fix rendering of example in diskSize 2024-11-14 18:12:16 +01:00
Dawid Dziurla ea9923c62f
nixos/incus: add incus-user service and socket 2024-11-13 12:25:40 +01:00
Sandro 681bc920f8
nixos/libvirt: fix shellcheck findings with enableStrictShellChecks enabled (#349620) 2024-11-12 19:18:26 +01:00
Sandro cd67342284
nixos/docker: keep live-restore disabled by default (#348983) 2024-11-05 16:44:19 +01:00
Sandro a96e4d9bfe
docker: use lib.versionOlder in literalExpression 2024-11-05 11:23:29 +01:00
Sandro a04d33c0c3
vmware-guest: allow the user to override the open-vm-tools package (#347939) 2024-11-05 02:08:39 +01:00
taku0 a009d2b73f nixos-container: do not touch os-release if it is a symlink
`/etc/os-release` of NixOS containers, which are
`/var/lib/nixos-containers/*/etc/os-release` on the host, are usually
symlinks to the absolute path `/etc/static/os-release` but it doesn't
exist in non-NixOS host.  Since `startScript` is evaluated by the host
system, both `[ -e "$root/etc/os-release" ]` and
`touch "$root/etc/os-release"` fail, so that the container fails to
start on the second boot (on the first boot, the symlink doesn't exist,
so the command succeeds).

This commit avoids `touch "$root/etc/os-release"` if
`$root/etc/os-release` is a symlink, so imperative NixOS containers are
usable on non-NixOS host.
2024-11-03 22:02:50 +09:00
Sefa Eyeoglu 12ba522dfd
nixos/docker: move imports
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2024-11-02 20:15:35 +01:00
benaryorg 048d8cceee
nixos/qemu-vm: minor readability improvements
The script generation is using the *lib.imap* functions in several other places already so this spot using a shell script variable instead seems a bit off.
Moving the previous shell script code to Nix improves upon the Nix code by removing the additional *lib.optionalString* for the variable initialisation making the code more concise.
The shell code is reduced to a one-liner per disk image, making it much easier to determine that this is a templated loop.

Compare the previous:

```bash
idx=0
if ! test -e "empty$idx.qcow2"; then
    /nix/store/73n3qwfazqw8zwr1z840jsirjllqpg9v-qemu-host-cpu-only-for-vm-tests-9.0.2/bin/qemu-img create -f qcow2 "empty$idx.qcow2" "20480M"
fi
idx=$((idx + 1))
if ! test -e "empty$idx.qcow2"; then
    /nix/store/73n3qwfazqw8zwr1z840jsirjllqpg9v-qemu-host-cpu-only-for-vm-tests-9.0.2/bin/qemu-img create -f qcow2 "empty$idx.qcow2" "20480M"
fi
idx=$((idx + 1))
if ! test -e "empty$idx.qcow2"; then
    /nix/store/73n3qwfazqw8zwr1z840jsirjllqpg9v-qemu-host-cpu-only-for-vm-tests-9.0.2/bin/qemu-img create -f qcow2 "empty$idx.qcow2" "20480M"
fi
idx=$((idx + 1))
```

and the new:

```bash
test -e "empty0.qcow2" || /nix/store/73n3qwfazqw8zwr1z840jsirjllqpg9v-qemu-host-cpu-only-for-vm-tests-9.0.2/bin/qemu-img create -f qcow2 "empty0.qcow2" "20480M"
test -e "empty1.qcow2" || /nix/store/73n3qwfazqw8zwr1z840jsirjllqpg9v-qemu-host-cpu-only-for-vm-tests-9.0.2/bin/qemu-img create -f qcow2 "empty1.qcow2" "20480M"
test -e "empty2.qcow2" || /nix/store/73n3qwfazqw8zwr1z840jsirjllqpg9v-qemu-host-cpu-only-for-vm-tests-9.0.2/bin/qemu-img create -f qcow2 "empty2.qcow2" "20480M"
```

While the line becomes slightly longer it also becomes immediately obvious on a visual level which parts are changing for each invocation (i.e. different disk sizes as well as the incremented counter stick out).
Since the "idx" variable is now embedded, this also becomes copy&pastable, and also shows the maximum index readily in the last line, as opposed to having to count the number of if statements otherwise.
None of this is *needed* of course.

Signed-off-by: benaryorg <binary@benary.org>
2024-11-02 02:57:40 +00:00
Jeremy Kolb c756281b2e Add kjeremy as a maintainer 2024-10-31 13:18:32 -04:00
Jeremy Kolb 145c5d03ad virtualisation.vmware.guest: allow the user to override the open-vm-tools package 2024-10-31 13:18:32 -04:00
Robert Hensing 2ba15d4f55
modules/virtualisation: add shared options, merge various diskSize options (#341058) 2024-10-27 17:49:33 +01:00
phaer c6da9ef32d modules/virtualisation: add unified diskSize opt
See https://github.com/NixOS/nixpkgs/pull/339535 and https://github.com/NixOS/nixpkgs/pull/341058
2024-10-27 12:28:37 +01:00
Sefa Eyeoglu 840af567fb
nixos/libvirt: fix shellcheck findings with enableStrictShellChecks enabled
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2024-10-18 22:02:14 +02:00
phaer 88b285c01d nixos/virtualisation: format image-related files 2024-10-18 13:32:50 +02:00
Friedrich Altheide 53b37c99b4 virtualbox: nixfmt 2024-10-16 13:15:42 +02:00
Sefa Eyeoglu 77a65d189a
nixos/docker: keep live-restore disabled by default
See https://docs.docker.com/engine/daemon/live-restore/
See https://discourse.nixos.org/t/docker-hanging-on-reboot/18270/5
Closes https://github.com/NixOS/nixpkgs/issues/182916

Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2024-10-16 11:17:37 +02:00
Sefa Eyeoglu 5900b644bb
nixos/docker: move live-restore option into daemon.settings
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2024-10-16 11:15:37 +02:00
Arian van Putten 0890727868 nixos/ec2-data: Make arianvp maintainer 2024-10-14 12:44:16 +02:00
nikstur ca8147e42e
qemu-vm: fix case-hack appearing in store image (#347636) 2024-10-12 21:50:11 +02:00
Pol Dellaiera a72a8bcfb3
treewide: fix typo chown -> chmod (#347678) 2024-10-10 10:55:34 +02:00
r-vdp 11d9033d85
nixos/ec2: Fix typo, chown -> chmod 2024-10-10 09:02:06 +02:00
Franz Pletz be6a26cae7
nixos/libvirtd: add startDelay and shutdownTimeout option (#347023) 2024-10-09 16:58:16 +02:00
Michael Hoang b2e9cc6167 qemu-vm: fix case-hack appearing in store image 2024-10-09 16:59:48 +11:00
Peder Bergebakken Sundt cd9a00431c
ec2: shellcheck fixes (#340489) 2024-10-07 15:39:38 +02:00
codgician 2a848b3732
nixos/libvirtd: add startDelay and shutdownTimeout option 2024-10-07 14:43:45 +08:00
Fernando Rodrigues 251dc99c70
nixos/xen: simplify package options
Signed-off-by: Fernando Rodrigues <alpha@sigmasquadron.net>
2024-10-06 20:24:29 +00:00
r-vdp cc28f2bef5
nixos/containers: Fix shellcheck issues 2024-10-03 17:57:41 +02:00
Emily 818089ba73
teams: create the Xen Project Team and rename instances of Xen to Xen Project. (#344314) 2024-09-28 15:57:32 +01:00
Fernando Rodrigues dc7db9bcc4
treewide: rename Xen to Xen Project
Xen is a trademark of the Cloud Software Group; we're not packaging
Xen(Server), we're packaging the Xen Project Hypervisor, which is open
source and owned by the Linux Foundation.

This is based on advice from Kelly Choi, the Xen Project Community
Manager, who has assisted us in the branding aspects of pacakaging.

Signed-off-by: Fernando Rodrigues <alpha@sigmasquadron.net>
2024-09-28 14:53:59 +00:00
Fernando Rodrigues 82f0ee2c5b
treewide: assign maintainership of the Xen-related packages to the Xen Project Hypervisor Team
Signed-off-by: Fernando Rodrigues <alpha@sigmasquadron.net>
2024-09-28 14:53:59 +00:00
K900 307dda84c0 nixos/nixos-containers: partially revert aa4570ca05
Word splitting is actually intentional here, as both of those variables
can (and often do) contain multiple flags.
2024-09-27 10:00:58 +03:00
r-vdp aa4570ca05
nixos/nixos-containers: fix shellcheck errors in systemd scripts 2024-09-26 21:54:07 +02:00
Will Fancher ea2838e1ce
nixos/qemu-vm: Ensure 9pnet_virtio module is loaded for shared dirs (#343574) 2024-09-25 23:11:08 -04:00
Will Fancher 4e54d10912 nixos/qemu-vm: Ensure 9pnet_virtio module is loaded for shared dirs
When `diskImage = null`, the root fs is a tmpfs instead of
`/dev/vda`. Thus, it doesn't have to wait for virtio modules to load
before being mounted. The root fs is a dependency of shared
directories by nature of being their parent directory. Without
depending on `/dev/vda`, these shared directories may attempt to mount
without virtio modules being loaded.
2024-09-25 17:37:34 -04:00
Artturin e0464e4788 treewide: replace stdenv.is with stdenv.hostPlatform.is
In preparation for the deprecation of `stdenv.isX`.

These shorthands are not conducive to cross-compilation because they
hide the platforms.

Darwin might get cross-compilation for which the continued usage of `stdenv.isDarwin` will get in the way

One example of why this is bad and especially affects compiler packages
https://www.github.com/NixOS/nixpkgs/pull/343059

There are too many files to go through manually but a treewide should
get users thinking when they see a `hostPlatform.isX` in a place where it
doesn't make sense.

```
fd --type f "\.nix" | xargs sd --fixed-strings "stdenv.is" "stdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "stdenv'.is" "stdenv'.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "clangStdenv.is" "clangStdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "gccStdenv.is" "gccStdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "stdenvNoCC.is" "stdenvNoCC.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "inherit (stdenv) is" "inherit (stdenv.hostPlatform) is"
fd --type f "\.nix" | xargs sd --fixed-strings "buildStdenv.is" "buildStdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "effectiveStdenv.is" "effectiveStdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "originalStdenv.is" "originalStdenv.hostPlatform.is"
```
2024-09-25 00:04:37 +03:00
Fernando Rodrigues da018db144
nixos/xen: fix spurious ShellCheck warning
It thinks we want to expand the `*` regex expressions inside the `sed`
commands. We do not.

Signed-off-by: Fernando Rodrigues <alpha@sigmasquadron.net>
2024-09-21 13:37:01 -03:00
Adam Stephens ee30c817cb
incus-lts: 6.0.1 -> 6.0.2
https://discuss.linuxcontainers.org/t/incus-6-0-2-lts-has-been-released/21633
2024-09-19 12:17:17 -04:00
Emily 5320e21a4b
nixos/xen: refactor dom0 configuration (#324911) 2024-09-18 23:22:38 +01:00
Fernando Rodrigues 9e5f77a3e2
nixos/xen: refactor dom0 configuration
- Cleans up downstream systemd units in favour of using upstream units.
- Xen 4.18 on Nixpkgs now supports EFI booting, so we have an EFI boot
  builder here that runs after systemd-boot-builder.py.
- Add more options for setting up dom0 resource limits.
- Adds options for the declarative configuration of oxenstored.
- Disables the automatic bridge configuration, as it was broken.
- Drops legacy BIOS boot
- Adds an EFI boot entry builder script.

Signed-off-by: Fernando Rodrigues <alpha@sigmasquadron.net>
Co-authored-by: Yaroslav Bolyukin <iam@lach.pw>
2024-09-18 17:36:39 -03:00
Fernando Rodrigues c3fa245245
nixos/xen: format with nixfmt-rfc-style
Signed-off-by: Fernando Rodrigues <alpha@sigmasquadron.net>
2024-09-17 21:02:14 +00:00
Graham Christensen 76b614be39 amazon-init: include the general system's software and wrappers in PATH
It is surprising that software which was installed by the user at AMI
generation time isn't available to a script run over user data by
default.

When authoring user data to execute at startup, users will now have
more predictable access to baked-in software instead of an extremely
bare-minimum set currently there.
2024-09-17 12:57:43 -04:00
Felix Buehler f1dfc8d363 nixos/virtualisation.vmware.guest: remove with lib; 2024-09-15 10:43:58 +02:00
Felix Buehler 7d7e294262 nixos/virtualbox-image: remove with lib; 2024-09-15 10:43:58 +02:00
Felix Buehler 217557441c nixos/virtualisation.virtualbox.host: remove with lib; 2024-09-15 10:43:58 +02:00
Felix Buehler 49fe5ca12c nixos/virtualisation.virtualbox.guest: remove with lib; 2024-09-15 10:43:58 +02:00
Felix Buehler 3cd35f7830 nixos/virtualisation.docker.rootless: remove with lib; 2024-09-15 10:43:58 +02:00
Sandro da1b2b5adb
nixos/profiles/minimal: drop noXLibs
noXLibs is an advanced option for advanced users which know how to recognize and debug build failures which might be caused by the added overlays.

The minimal profile should be minimal but also save to use for many people and not cause build failures in packages it really shouldn't.
2024-09-14 00:59:14 +02:00
Weijia Wang 7cd6534e42
linuxPackages_latest.prl-tools: 19.4.1-54985 -> 20.0.0-55653 (#341283) 2024-09-13 11:50:54 +02:00
codgician 0d25a978f2
parallels-guest: remove autoMountShares 2024-09-13 00:47:01 +08:00
K900 5cef278170 nixos/qemu-vm: expose installBootLoader as an option, assert when it's enabled without stc
We need stc to actually, well, install the bootloader.
2024-09-12 15:43:28 +03:00
nicoo 9e5a44bcfc
nixos/podman: set preferLocalBuild on trivial runCommands (#340980) 2024-09-10 10:53:46 +00:00
Martin Weinelt 4cec81a995
Revert "modules/virtualisation: add shared options, merge various diskSize options" (#340894)
Breaks evaluation of all nixos tests, and is therefore a channel blocker.
2024-09-10 03:12:55 +02:00
Jonas Chevalier 7c4dde339a
modules/virtualisation: add shared options, merge various diskSize options (#339535) 2024-09-09 21:23:11 +02:00
Aleksana 03e62e5bc3
podman: drop slirp4netns which has been replaced by passt (#313670) 2024-09-09 09:53:33 +08:00
r-vdp 8e325b5086
ec2: shellcheck fixes 2024-09-08 12:27:58 +02:00
phaer b6114fd1d5 hyperv-image: double default size 2024-09-05 15:56:25 +02:00
phaer 3a505620ec hyperv-image: use virtualisation.diskSize 2024-09-05 15:56:25 +02:00
phaer f8a876644b virtualbox-image: use virtualisation.diskSize 2024-09-05 15:56:25 +02:00
phaer a4b1638f7f azure-image: use virtualisation.diskSize 2024-09-05 15:56:25 +02:00
phaer d223461d54 digital-ocean-image: use virtualisation.diskSize
This makes negative diskSizes, that were previously allowed illegal.
2024-09-05 15:56:25 +02:00
phaer d37a3ea1ef promox-image: use virtualisation.diskSize 2024-09-05 15:56:24 +02:00
phaer 9e18e9fedc google-compute-image: use virtualisation.diskSize 2024-09-05 15:56:24 +02:00
phaer 048599f0d7 linode-image: use virtualisation.diskSize 2024-09-05 15:56:24 +02:00
phaer 564b6ce153 oci-{options,image}: use virtualisation.diskSize 2024-09-05 15:56:24 +02:00
phaer 39df221e77 virtualisation-options: init
see header comment in virtualisation-options.nix
2024-09-05 15:56:24 +02:00
phaer 04fadac429 run nixfmt-rfc-style 2024-09-05 15:56:22 +02:00
phaer 74180c6159 brightboxImage: remove, as it seems unmaintained
...and is broken/flaky on master, due to custom script with mknod usage.
2024-09-05 14:40:29 +02:00
Sandro 6e055283a9
virtualisation/azure-images: drop outdated list... (#338426) 2024-09-03 21:16:39 +02:00
Jon Seager d6834ede48
nixos/vmware.guest: disable xf86inputvmmouse on aarch64 (#326395) 2024-09-03 08:02:55 +01:00
phaer 53df1e4ece virtualisation/qemu-vm: disallow nullable diskSize
Because `virtualisation.diskSize = null` does result in a broken vm runner,
see https://github.com/NixOS/nixpkgs/issues/292901.

diskSize was declared to be nullable when it first got types in a
tree-wide commit:
30f0faac22

But it seemingly never actually supported it, as "${cfg.diskSize}M" is
passed to qemu-img create, which doesn't allow an empty size parameter.

closes: https://github.com/NixOS/nixpkgs/issues/292901
2024-09-02 12:09:15 +02:00
Philip Taron 9916dc8728
treewide/nixos: remove with lib; part 2 (#335618) 2024-08-30 15:56:57 -07:00
Felix Buehler dcb2e4eba4 nixos/services.xe-guest-utilities: remove with lib; 2024-08-30 23:01:45 +02:00
Felix Buehler 3e5d6ba7df nixos/virtualisation.vmware.image: remove with lib; 2024-08-30 23:01:45 +02:00
phaer 6b6a7fbc3a virtualisation/azure-images: drop outdated list...
This list of microsoft-hosted, pre-built azure-images might have been
useful, but it hasn't seen any updates since NixOS 16.0.9, eight years
ago. As there is also no in-tree usage, and the results of a quick
GitHub search yielded no out-tree usage which was *not* either about
the same age or looked like vendored copies of this list, this seems
safe to drop to me.
2024-08-30 17:36:48 +02:00
Jonas Chevalier 1e9fccb79f
nixos/azure: add Gen 2 VM, aarch64 and accelerated networking support (#333508) 2024-08-30 10:59:49 +02:00
Matteo Sozzi 389de87aed
lxc: added option for unprivileged containers.
Added extra option to enable unprivileged containers. This includes a
patch to remove the hard-coded path to `lxc-user-nic` and a new security
wrapper to set SUID to `lxc-user-nic`.
2024-08-28 09:18:23 -04:00
Robert Hensing 727351517e
Merge pull request #335660 from Gabriella439/gabriella/containers_nixpkgs.pkgs
containers.*.config.nixpkgs: use `host.pkgs.stdenv.hostPlatform`
2024-08-25 14:40:31 +02:00
Franz Pletz 35b2bfb7ed
Merge pull request #335967 from CajuM/waydroid-svc-stop 2024-08-25 01:40:42 +02:00
Mihai-Drosi Câju 05313fc5b3 nixos/waydroid: Update service definition according to upstream
* Upstream switched the service's Type to dbus in 1.4.0
* Enable D-Bus activation
* Fixes #334687
2024-08-24 19:48:20 +03:00
Gabriella Gonzalez 0b6fa5ee40
virtualisation.oci-containers: Add new imageStream option (#335430)
This adds a new `imageStream` option that can be used in conjunction
with `pkgs.dockerTools.streamLayeredImage` so that the image archive
never needs to be materialized in the `/nix/store`.  This greatly
improves the disk utilization for systems that use container images
built using Nix because they only need to store image layers instead of
the full image.  Additionally, when deploying the new system and only
new layers need to be built/copied.
2024-08-24 04:38:27 +02:00
Someone 2d7db58c2f
Merge pull request #313225 from ereslibre/nvidia-consistent-casing
docs: fix Nvidia casing to be consistent across different places
2024-08-22 16:51:41 +00:00
Someone 4c930c0635
Merge pull request #331071 from ereslibre/fix-nvidia-container-toolkit-docker-contamination
Fix nvidia container toolkit docker contamination
2024-08-22 16:40:06 +00:00
Jared Baur cd998f9de9
nixos/qemu-vm: suppress mkfs.erofs output
The mkfs.erofs utility has a lot of output by default that slows down
running tests. We don't need to capture any of the output from
mkfs.erofs, so we can suppress it.
2024-08-19 14:55:55 -07:00
Gabriella Gonzalez 79e5dbb262 Restore check for container not defining nixpkgs.hostPlatform option 2024-08-18 17:00:16 -07:00
Gabriella Gonzalez 0600255046 Use host.pkgs.stdenv.hostPlatform 2024-08-18 16:49:57 -07:00
Gabriella Gonzalez de83fcb2df containers.*.config: reuse host nixpkgs.pkgs if defined
The minimum reproduction for the problem I'm trying to solve is that
the following NixOS test with a trivial NixOS container:

```
{ inputs = {
    nixpkgs.url = "github:NixOS/nixpkgs/24.05";

    flake-utils.url = "github:numtide/flake-utils/v1.0.0";
  };

  outputs = { flake-utils, nixpkgs, self, ... }:
    flake-utils.lib.eachDefaultSystem (system: {
      checks.default = nixpkgs.legacyPackages."${system}".nixosTest {
        name = "test";

        nodes.machine.containers.tutorial.config = { };

        testScript = "";
      };
    });
}
```

… fails with the following error message:

```
error: Neither nodes.machine.nixpkgs.hostPlatform nor the legacy option nodes.machine.nixpkgs.system has been set.
You can set nodes.machine.nixpkgs.hostPlatform in hardware-configuration.nix by re-running
a recent version of nixos-generate-config.
The option nodes.machine.nixpkgs.system is still fully supported for NixOS 22.05 interoperability,
but will be deprecated in the future, so we recommend to set nodes.machine.nixpkgs.hostPlatform.
```

The root of the problem appears to be that in
`nixos/modules/virtualisation/nixos-containers.nix` there is support
for deriving the guest's `nixpkgs.hostPlatform` or
`nixpkgs.localSystem` from the corresponding host's values, but this
doesn't work if the host sets `nixpkgs.pkgs` instead of one of those
values.  In fact, this is what happens when using `pkgs.nixosTest`
(which sets `nixpkgs.pkgs` in
`pkgs/build-support/testers/default.nix`).

The solution I went with was to forward the `nixpkgs.pkgs` setting from
the host to the guest, but only if it is defined (matching the same
treatment as `nixpkgs.hostPlatform` and `nixpkgs.localSystem`.
2024-08-18 11:32:46 -07:00
Adam Stephens 659308a8c1
nixos/incusContainer: create hydra build product 2024-08-17 09:01:17 -04:00
Fabián Heredia Montiel 2c94341824
Merge pull request #328532 from LeSuisse/openstack-config-no-default-root-password
openstack-config: remove hardcoded default password for the root account
2024-08-16 12:30:12 -06:00
Rafael Fernández López 058e8f5ef1
nvidia-podman: remove nvidia wrapper
Since version 4.1.0, podman has support for CDI, and is the
recommended way to expose GPU's for containers for podman.

More information: https://web.archive.org/web/20240729183805/https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/install-guide.html#configuring-podman
2024-08-16 18:16:23 +02:00
Rafael Fernández López f7b4d57421
virtualisation/docker: fix nvidia wrapper
Although CDI should be used in order to not require container runtime
wrappers anymore, fix the nvidia-container-runtime integration with
Docker for cases when Docker < 25.
2024-08-16 15:49:35 +02:00
codgician 94683f9e55 azure-common: take networkmanager users into account for accelerated networking 2024-08-14 11:02:58 +08:00
Pol Dellaiera c556059765
Merge pull request #334344 from truh/docs/oci-containers-docs-urls
nixos/oci-containers: replace broken links to docker docs
2024-08-13 20:44:55 +02:00
Adam C. Stephens 7e95d0361c
Merge pull request #333730 from adamcstephens/incus/from-lxd
nixos/incus: add incus-only vm and container images
2024-08-13 08:39:26 -04:00
Jakob Klepp 0b8954f8d2 nixos/oci-containers: replace broken links to docker docs
Old links in descriptions now lead to 404 pages.
2024-08-13 11:49:08 +02:00
codgician 88c5242599 azure-common: remove bootloader timeout since we can access serial console now 2024-08-13 17:39:47 +08:00
Philip Taron c44e170e3f
nixos/proxmox-lxc: lib.mdDoc is deprecated 2024-08-12 08:02:57 -07:00
Adam Stephens ac18c4d1e9
treewide: remove lxc team from lxd packages and modules
LXD is not under the LXC project any longer
2024-08-10 13:23:38 -04:00
Adam Stephens 094f2b6c9d
nixos/incus: add incus-only vm and container images 2024-08-10 13:23:36 -04:00
Adam Stephens 293c17926d
nixos/incus-agent: init 2024-08-10 12:08:33 -04:00
codgician 028138f201 azure-common: put mlx drivers into availableKernelModules 2024-08-10 11:47:18 +08:00
codgician 1f26575842 azure-common: rm trailing whitespace 2024-08-10 02:03:27 +08:00
codgician 5b4f446d6a azure-common: improve code style 2024-08-09 15:17:12 +08:00
codgician 85fcdad66c azure-common: fix unsupported attribute 2024-08-09 15:10:07 +08:00
codgician 0769bb8aac azure-image: support creating v2 image 2024-08-09 14:47:30 +08:00
codgician f6fe3b3bff azure-common: add accelerated networking configs 2024-08-09 08:47:10 +08:00
codgician 0799550a95 azure-agent: remove x86 assertion 2024-08-09 08:46:10 +08:00
Aleksana e38e6a4490
Merge pull request #328164 from truh/docs/oci-containers-firewall-bypass
nixos/oci-containers: document firewall bypass
2024-08-04 16:35:23 +08:00
Winter 6c11488ce0 Revert "nixos/podman: use given package for dockerCompat"
This reverts commit df74ebcabb, which breaks
eval when Podman is enabled due to infinite recursion [0] [1].

I take full responsibility for merging this without looking too closely
nor running the NixOS test.

[0]: df74ebcabb (commitcomment-145003824)
[1]: https://github.com/NixOS/nixpkgs/pull/267321#issuecomment-2267076978
2024-08-03 15:13:24 -04:00
Chris Maniewski df74ebcabb nixos/podman: use given package for dockerCompat
Defining a package that isn't the default results in podman-compat linking to a different version of podman (always the default one). This PR changes the behavior so that the given alternative package is used for the dockerCompat option as well. This could technically break things for people who rely on this quirk, albeit the previous behavior is probably not what one would expect.

Co-authored-by: Winter <winter@winter.cafe>
2024-08-03 10:54:26 -04:00
Arian van Putten 4e4b14e3f6 nixos/lxd: delegate cgroup to lxd
Just doing what arch does as well: https://gitlab.archlinux.org/archlinux/packaging/packages/lxd/-/blob/main/lxd.service?ref_type=heads

Also container managers should always have this option set. See https://systemd.io/CONTAINER_INTERFACE/
2024-07-31 13:49:58 +02:00
Arian van Putten ee81fdfa56 nixos/lxd: use unified cgroup hierachy 2024-07-31 13:49:58 +02:00