Commit Graph

1921 Commits

Author SHA1 Message Date
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
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
Thomas Gerbet
66c0275843 openstack-config: remove hardcoded default password for the root account 2024-07-19 21:24:37 +02:00
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
Spencer Heywood
bb0c512b54
nixos/vmware.guest: disable xf86inputvmmouse on aarch64 2024-07-11 16:52:22 -06:00
Basti
56e8106538
Remove trailing whitespace 2024-07-09 22:14:23 +00:00
Basti
2232311c93
Update nixos/modules/virtualisation/podman/default.nix 2024-07-09 22:12:12 +00: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
Sandro Jäckel
e2e28f84f3
nixos/podman: add slirp4netns if configured 2024-06-11 01:01:19 +02:00
Arnout Engelen
2389f5fdc3
virtualbox guest module: draganddrop became dragAndDrop (#317756)
Co-authored-by: Sandro <sandro.jaeckel@gmail.com>
2024-06-06 16:48:47 +02:00
tomf
b2b3f5d68d
nixos/oci-containers: add preRunExtraOptions (#315356)
`podman --help` and `docker --help` each have global options, that
must be specified before `run`.
2024-06-05 18:18:37 -04:00
a-kenji
406e613b95 nixos/virtualbox-host: fix typo in assertion 2024-06-05 14:04:03 +02:00
Sandro Jäckel
41452802cb
treewide: fix all obviously wrong mkEnableOptions 2024-06-03 13:20:32 +02:00
illustris
da799551a4
nixos/proxmox-lxc: fix console access (#307163)
Co-authored-by: Sandro <sandro.jaeckel@gmail.com>
2024-06-03 00:15:27 +02:00
Sandro
1e8d02875f
Merge pull request #307287 from illustris/proxmox-vma 2024-06-03 00:12:40 +02:00
Onur C. Cakmak
b3f70c29d5
nixos/containerd: remove LimitNOFILE from service (#313507) 2024-06-02 17:51:10 +02:00
Arnout Engelen
61c1d28215
Merge pull request #303790 from FriedrichAltheide/cleanup-virtualbox
virtualbox & virtualboxGuestAdditions: cleanup
2024-06-01 13:42:14 +02:00
Rafael Fernández López
7749696f61 docs: fix Nvidia casing to be consistent across different places 2024-05-20 22:17:31 +02:00
Fabian Möller
da68f358bc
treewide: Remove usage of pkgs.{system,hostPlatform} aliases
These aliases should not be used inside nixpkgs and are only there for backward
compatibility.
2024-05-16 11:48:32 +02:00
Friedrich Altheide
64512b6200 virtualboxGuestAdditions: Add dragAndDrop service 2024-05-13 06:36:03 +02:00
Adam C. Stephens
215dd64e07
Merge pull request #307039 from adamcstephens/nixos-unstable
nixos/incus: add support for soft daemon restarts
2024-05-09 09:59:37 -04:00
Adam Stephens
7d5b333dcd
nixos/incus: add support for soft daemon restart
This is a feature supported out of the box by upstream and allows the
incusd service to be restarted without impacting running
instances. While this does give up a bit of reproducibility, qemu and
lxc for example, there are clear benefits in allowing the host to
apply updates without impacting instances.

Modeled after the zabbly implementation: 2a67c3e260/systemd/incus-startup.service

This will now be the default.
2024-05-09 09:01:12 -04:00
Sandro Jäckel
d8137e77ec
nixos/containers: set storage.settings via mkDefault
to make them easily overwriteable, aka without mkForce
2024-05-06 16:34:00 +02:00
Leona Maroni
d9bdb87f7d
Merge pull request #307498 from SuperSandro2000/podman-storage-default
nixos/containers: move storage.settings default into config
2024-05-03 22:31:06 +02:00
Robert Hensing
188ba247d5
nixos/podman: Create docker socket symlink via socket unit (#305803)
This ensures that both "sockets" are available after sockets.target.
See https://github.com/hercules-ci/arion/issues/238
2024-05-02 14:04:37 +00:00
Adam C. Stephens
51cc3442af
Merge pull request #307218 from adamcstephens/incus/more-deps
nixos/incus: add missing packages to path
2024-05-01 09:08:22 -04:00