about summary refs log tree commit diff
path: root/nixos/modules/system
diff options
context:
space:
mode:
authorFlorian Klink <flokli@flokli.de>2020-05-05 13:41:12 +0200
committerFlorian Klink <flokli@flokli.de>2020-05-05 15:59:30 +0200
commit7426bec45ef03c55bfc5bb27cdc60d6163aeed04 (patch)
treec2ee7d01ac845e8f4440780fc08488218ff52d7e /nixos/modules/system
parent499b5feac9dfad6706519b123ce201defd74b2ea (diff)
downloadnixlib-7426bec45ef03c55bfc5bb27cdc60d6163aeed04.tar
nixlib-7426bec45ef03c55bfc5bb27cdc60d6163aeed04.tar.gz
nixlib-7426bec45ef03c55bfc5bb27cdc60d6163aeed04.tar.bz2
nixlib-7426bec45ef03c55bfc5bb27cdc60d6163aeed04.tar.lz
nixlib-7426bec45ef03c55bfc5bb27cdc60d6163aeed04.tar.xz
nixlib-7426bec45ef03c55bfc5bb27cdc60d6163aeed04.tar.zst
nixlib-7426bec45ef03c55bfc5bb27cdc60d6163aeed04.zip
nixos/systemd/resolved: add resolve to nss hosts database if enabled
We keep the "only add the nss module if nscd is enabled" logic for now.

The assertion never was triggered, so it can be removed.
Diffstat (limited to 'nixos/modules/system')
-rw-r--r--nixos/modules/system/boot/resolved.nix4
1 files changed, 4 insertions, 0 deletions
diff --git a/nixos/modules/system/boot/resolved.nix b/nixos/modules/system/boot/resolved.nix
index da61c64faf8b..b7aaef575ac1 100644
--- a/nixos/modules/system/boot/resolved.nix
+++ b/nixos/modules/system/boot/resolved.nix
@@ -138,6 +138,10 @@ in
 
     users.users.resolved.group = "systemd-resolve";
 
+    # add resolve to nss hosts database if enabled and nscd enabled
+    # system.nssModules is configured in nixos/modules/system/boot/systemd.nix
+    system.nssDatabases.hosts = optional config.services.nscd.enable "resolve [!UNAVAIL=return]";
+
     systemd.additionalUpstreamSystemUnits = [
       "systemd-resolved.service"
     ];