nixpkgs/nixos/modules
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
..
config Merge pull request #312516 from Stunkymonkey/nixos-swap-umask 2024-06-20 20:06:13 +02:00
hardware nixos/hardware/video/virtualbox: move from generic opengl module 2024-06-16 14:11:33 +03:00
i18n/input-method nixos: remove all uses of lib.mdDoc 2024-04-13 10:07:35 -07:00
image repart-image: removing unshare (and util-linux dep) form systemd-repart invocation 2024-06-03 17:48:27 -07:00
installer nixVersions.nix_2_18: 2.18.2 -> 2.18.3 2024-06-22 10:56:11 +02:00
misc treewide: fix mkEnableOption usage 2024-06-14 02:41:42 -04:00
profiles nixos/top-level: Rename system.forbiddenDependenciesRegex to system.forbiddenDependenciesRegexes 2024-05-02 21:08:39 +03:00
programs Merge pull request #316977 from eclairevoyant/fix-mkEnableOption 2024-06-25 22:42:16 +02:00
security Merge pull request #322194 from Artturin/polkitaddpackageoption 2024-06-26 12:42:38 +03:00
services Merge pull request #321591 from JohnRTitor/gdm-fingerprint-auth 2024-06-26 23:08:16 +05:30
system nixos/virtualisation: increase priority for libvirt NSS modules 2024-06-25 20:22:14 +02:00
tasks nixos/clevis: add support for parent encrypted zfs datasets 2024-06-12 21:21:50 +03:00
testing treewide: fix mkEnableOption usage 2024-06-14 02:41:42 -04:00
virtualisation nixos/virtualisation: increase priority for libvirt NSS modules 2024-06-25 20:22:14 +02:00
module-list.nix Merge pull request #272895 from xanderio/wg-access-server-0.10.1 2024-06-25 21:21:19 +02:00
rename.nix nixos/pantheon-tweaks: remove 2024-05-22 21:58:16 +08:00