Commit Graph

1837 Commits

Author SHA1 Message Date
Adam Stephens
293c17926d
nixos/incus-agent: init 2024-08-10 12:08:33 -04: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
Masum Reza
184957277e
Merge pull request #322282 from tylerjl/tylerjl/print-host-key-soft-fail
nixos/ec2-data: skip unrecognized keys in print-host-keys
2024-07-31 10:59:10 +05:30
Rafael Fernández López
3d2a21eddf virtualisation/{docker,podman}: update nvidia-ctk warning
Warnings and descriptions for `virtualisation.docker.enableNvidia` and
`virtualisation.podman.enableNvidia` point erroneously to set
`virtualisation.containers.cdi.dynamic.nvidia.enable`. This NixOS
option has been deprecated and the recommended NixOS option is
`hardware.nvidia-container-toolkit.enable`.
2024-07-28 13:12:27 +02:00
Sohalt
c11439943d
nixos/containers: add wants and after dependency for network interfaces (#153234)
Co-authored-by: Franz Pletz <fpletz@fnordicwalking.de>
2024-07-22 01:22:19 +02:00
Sandro
49831e2e65
Merge pull request #328604 from illustris/pve-kvm
nixos/proxmoxImage: fix build
2024-07-21 21:23:06 +02:00
Franz Pletz
1a3c164570
Merge pull request #328682 from fpletz/nixos/fix-proxmox-lxc 2024-07-21 09:09:40 +02:00
Adam C. Stephens
65ef67740b
Merge pull request #328665 from adamcstephens/incus/fix-lts-unstable
incus: fix OVMF path backward compatibility
2024-07-20 14:09:46 -04:00
lassulus
e209fc2f2f
Merge pull request #241373 from nikstur/qemu-vm-simplify-nix-store-image
nixos/qemu-vm: simplify building nix store image
2024-07-20 19:27:40 +02:00
Franz Pletz
ceafec213f
nixos/proxmox-lxc: fix nixos-rebuild
Same is being done in lxc-container module.
2024-07-20 16:54:29 +02:00
Franz Pletz
c501d3fa97
nixos/proxmox-lxc: fix getty start
Otherwise there is no getty on tty1 in Proxmox.
2024-07-20 16:54:28 +02:00
Franz Pletz
4aa419c046
nixos/proxmox-lxc: reformat 2024-07-20 16:54:28 +02:00
Franz Pletz
7c67f72893
Merge pull request #320075 from illustris/pve-lxc-ping-fix 2024-07-20 16:52:05 +02:00
Adam Stephens
28922c4421
incus: fix OVMF path backward compatibility
incus 6.3.0 changed the OVMF path, but our module needs to support LTS
as well. Also move the newer OCI deps to be conditional on version.
2024-07-20 09:54:07 -04:00
illustris
0dca765a25
nixos/proxmoxImage: fix build 2024-07-20 12:12:16 +05:30
nikstur
289dd22132 nixos/qemu-vm: simplify building nix store image
Summary of this change:

- Simplify code.
- Stop a disk image from being cached in the binary cache.
- Make erofs Nix Store image build in an acceptable time outside of
  testing environments (like `darwin.builder`).
- Do not regress on performance for tests that use many store paths in
  their Nix store image.
- Slightly longer startup time for tests where not many store paths are
  included in the image (these probably shouldn't use `useNixStoreImage`
  anyways).
- Slightly longer startup time when inputs of VM do not change because
  the Nix store image is not cached anymore.

Remove the `storeImage` built with make-disk-image.nix. This produced a
separate derivation which is then cached in the binary cache. These
types of images should be avoided because they gunk up the cache as they
change frequently. Now all Nix store images, whether read-only or
writable are based on the erofs image previously only used for read-only
images.

Additionally, simplify the way the erofs image is built by copying the
paths to include to a separate directory and build the erofs image from
there.

Before this change, the list of Nix store paths to include in the Nix
store image was converted to a complex regex that *excludes* all other
paths from a potentially large Nix store.

This previous approach suffers from two issues:

1. The regex is complex and, as admitted in the source code of the
   includes-to-excludes.py script, most likely contains at least one
   error. This means that it's unlikely that anyone will touch this
   piece of software again.

2. When the Nix store image is built from a large Nix store (like when
   you build the VM script to run outside of any testing context) this
   regex becomes painfully slow. There is at least one prominent
   use-case where this matters: `darwin.builder`.

Benchmarking impressions:

- Building Nix store via make-disk-image.nix takes ~25s
- Building Nix store as an erofs image takes ~4s
- Running nixosTests.qemu-vm-writable-store-image takes ~10s when
  building the erofs image with the regex vs ~14s when building by
  copying to a temporary directory.
- nixosTests.gitlab which had the biggest gains from the initial erofs
  change takes the same time as before.
- On a host with ~140k paths in /nix/store, building the erofs image
  with the regex takes 410s as opposed to 6s when copying to a temporary
  directory.
2024-07-18 20:24:58 +02:00
lassulus
a62c421981
Merge pull request #290730 from nikstur/qemu-vm-refactoring
qemu-vm.nix refactoring
2024-07-18 19:34:51 +02:00
nikstur
b6e354f052 nixos/qemu-vm: remove creation of /etc/nixos
/etc/nixos is already created by stage-2-init.sh
2024-07-18 19:11:28 +02:00
nikstur
cb5a876e82 nixos/qemu-vm: consistently use efiSysMountPoint
Remove the explicit creation of efiSysMountPoint. This is not needed in
the scripted or the systemd initrd.
2024-07-18 19:11:27 +02:00
nikstur
b7b90d0455 nixos/qemu-vm: fsck ESP
The ESP is a writable vfat filesystem that can be fscked like any other
fs thus we should stick to the default.
2024-07-18 19:11:27 +02:00
nikstur
ded6d983d6 nixos/qemu-vm: use new overlayfs API 2024-07-18 19:11:24 +02:00
nikstur
54674e9063 nixos/qemu-vm: remove duplication between scripted and systemd initrd 2024-07-18 19:09:28 +02:00
Jakob Klepp
c5c92feff7
nixos/oci-containers: document firewall bypass
Add explanation about the security impact of the
ports option.
Provide a safer example.

The problem is discussed in greater depth here:
https://github.com/NixOS/nixpkgs/issues/111852
2024-07-18 14:32:08 +02:00
Frédéric Christ
c6f6c28218 nixos/testing: Add ipv6 configuration
This contribution enables a working IPv6 setup by default. This works
analog to the current automatic IPv4 setup.
2024-07-18 10:22:32 +02:00
Sandro
c0e4367e8f
Merge pull request #267764 from Silver-Golden/nixos/proxmox-lxc-import-not-activate 2024-07-16 17:02:47 +02:00
Philip Taron
2e17c4a4da
nixos/amazon-image: avoid top-level with statements 2024-07-15 22:02:39 -07:00
Adam C. Stephens
a167a16697
Merge pull request #326620 from bbigras/incus
incus: 6.2.0 -> 6.3.0
2024-07-15 14:47:18 -04:00
Bruno Bigras
856651fda8 nixos/incus: INCUS_OVMF_PATH -> INCUS_EDK2_PATH 2024-07-15 12:10:50 -04:00
K900
3eeff54780 nixos/alsa: kill sound.enable and friends with fire 2024-07-13 13:56:18 +03:00
Bruno Bigras
c2a12db1a4 nixos/incus: add skopeo and umoci 2024-07-12 16:34:17 -04:00
Aleksana
d5a4f459ea
Merge pull request #304362 from Stunkymonkey/ec2-data-chmod-install
ec2-data: prefer 'install/umask' over 'chmod'
2024-07-04 12:51:53 +08:00
Felix Buehler
6fd0acb81b ec2-data: prefer 'install/umask' over 'chmod' 2024-07-03 23:18:43 +02:00
Nick Cao
ffa6fef5ad
Merge pull request #321010 from blitz/virtualbox-kvm
virtualboxKvm: 20240515 -> 20240617
2024-06-30 09:53:43 -04:00
Brendan Golden
c20f3b70ab nixos/proxmox-lxc: allow importing module without activation, for used in mixed machine clusters 2024-06-27 13:05:05 +01:00
Sandro
33f83c6252
Merge pull request #316977 from eclairevoyant/fix-mkEnableOption
treewide: fix mkEnableOption usage
2024-06-25 22:42:16 +02:00
Michael Franzl
cae086d605
nixos/virtualisation: increase priority for libvirt NSS modules
When `services.resolved` is enabled, then `resolve [!UNAVAIL=return]`
is added to `system.nssDatabases.hosts` with priority 501,
which prevents lower-priority NSS modules from running
unless systemd-resolved is not available.

Quoting from `man nss-resolve`:

> To activate the NSS module, add "resolve [!UNAVAIL=return]" to the line
> starting with "hosts:" in /etc/nsswitch.conf. Specifically, it is
> recommended to place "resolve" early in /etc/nsswitch.conf's "hosts:"
> line. It should be before the "files" entry, since systemd-resolved
> supports /etc/hosts internally, but with caching. To the contrary, it
> should be after "mymachines", to give hostnames given to local VMs and
> containers precedence over names received over DNS. Finally, we
> recommend placing "dns" somewhere after "resolve", to fall back to
> nss-dns if systemd-resolved.service is not available.

Note that the man page (just) recommends "early" and means with this
"before the 'files' and 'dns' entries". It does not insist on being
first or excluding other modules.

For this reason, libvirt NSS modules should run before the `resolve`
module. They should come right next to `mymachines` because both are
conceptually very similar -- they resolve local VMs/containers.

Since the data source of the libvirt NSS modules are local
plain text files (see source code of the libvirt NSS module),
no performance impact is expected form this raise of priorities.

Other NSS modules in NixOS also explicitly set their priority, which is
why this change increases consistency.

Fixes #322022
2024-06-25 20:22:14 +02:00
Franz Pletz
e6e4cd92ad
Merge pull request #322211 from NyCodeGHG/update-libvirt
libvirt: 10.0.0 -> 10.4.0, nixos/libvirtd: add ssh proxy option
2024-06-25 05:47:13 +02:00
Tyler Langlois
404fb5ab9c nixos/ec2-data: skip unrecognized keys in print-host-keys
The recent move to strip out DSS support from the openssh package
means that older key formats cause the key-printing command to
fail. Rather than causing the entire unit to fail, we should instead
skip those keys - while still letting the error through to the
console - and continue to print other keys the loop may find.
2024-06-24 16:08:59 -06:00
Felix Bühler
e1f89770af
Merge pull request #302909 from Stunkymonkey/vagrant-guest-install-chmod
nixos/vagrant-guest: prefer 'install' over 'chmod'
2024-06-24 19:47:59 +02:00
Marie Ramlow
35b3707f20 nixos/libvirtd: add ssh proxy option 2024-06-24 17:20:05 +02:00
Linus Heckemann
e5adf0b547 maintainers: drop lheckemann 2024-06-21 15:54:54 +02:00
Sirio Balmelli
80712f254c
nixos/oci-image: expose diskSize as a configurable option
diskSize defaults to the previous hard-coded 8192:
no change for existing users.

Users can set diskSize when building images which require
larger disk space; thus avoiding the error:

    ERROR: cptofs failed. diskSize might be too small for closure.

Signed-off-by: Sirio Balmelli <sirio@b-ad.ch>
Co-authored-by: superherointj <5861043+superherointj@users.noreply.github.com>
2024-06-21 08:54:08 +02:00
Julian Stecklina
9cec4b55f6 nixos/virtualbox-host: remove obsolete warnings
Version 20240617 of the KVM patch allows for turning hardening on in
VirtualBox.
2024-06-19 09:42:54 +02:00
K900
98cef4c273 treewide: big opengl cleanup
- rename hardware.opengl to hardware.graphics
- remove hardware.opengl.driSupport, which does nothing
- remove hardware.opengl.setLdLibraryPath, which should never be done
- rename hardware.opengl.driSupport32Bit to hardware.graphics.enable32Bit
- lost of small docs / formatting cleanups
2024-06-16 14:11:33 +03:00
illustris
01b159092f
nixos/proxmox-lxc: fix ping in unprivileged LXCs 2024-06-15 20:29:01 +05:30
éclairevoyant
7d8742da87
treewide: fix mkEnableOption usage 2024-06-14 02:41:42 -04:00