about summary refs log tree commit diff
path: root/nixos/modules/system/boot
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2015-05-11 15:54:16 +0200
committerEelco Dolstra <eelco.dolstra@logicblox.com>2015-05-11 18:18:36 +0200
commitf19b58fb6a5cc55af6d8d8ca7979f8e64255d2d0 (patch)
tree2b53bd704774af96952ba18fdfc50aba6f62f3f7 /nixos/modules/system/boot
parentc52a98380673093037a3116025d0aa92cd46a214 (diff)
downloadnixlib-f19b58fb6a5cc55af6d8d8ca7979f8e64255d2d0.tar
nixlib-f19b58fb6a5cc55af6d8d8ca7979f8e64255d2d0.tar.gz
nixlib-f19b58fb6a5cc55af6d8d8ca7979f8e64255d2d0.tar.bz2
nixlib-f19b58fb6a5cc55af6d8d8ca7979f8e64255d2d0.tar.lz
nixlib-f19b58fb6a5cc55af6d8d8ca7979f8e64255d2d0.tar.xz
nixlib-f19b58fb6a5cc55af6d8d8ca7979f8e64255d2d0.tar.zst
nixlib-f19b58fb6a5cc55af6d8d8ca7979f8e64255d2d0.zip
Create systemd-{network,resolve} user/group unconditionally
This shuts up this error from dbus:

May 11 13:52:16 machine dbus-daemon[259]: Unknown username "systemd-network" in message bus configuration file
May 11 13:52:16 machine dbus-daemon[259]: Unknown username "systemd-resolve" in message bus configuration file

which happens because the D-Bus config for networkd/resolved is
enabled unconditionally, and we don't have an easy way to turn it off.
Diffstat (limited to 'nixos/modules/system/boot')
-rw-r--r--nixos/modules/system/boot/networkd.nix3
-rw-r--r--nixos/modules/system/boot/resolved.nix3
-rw-r--r--nixos/modules/system/boot/systemd.nix5
3 files changed, 5 insertions, 6 deletions
diff --git a/nixos/modules/system/boot/networkd.nix b/nixos/modules/system/boot/networkd.nix
index b183c0f32366..34eea9af83b1 100644
--- a/nixos/modules/system/boot/networkd.nix
+++ b/nixos/modules/system/boot/networkd.nix
@@ -641,9 +641,6 @@ in
     environment.etc."systemd/network".source =
       generateUnits "network" cfg.units [] [];
 
-    users.extraUsers.systemd-network.uid = config.ids.uids.systemd-network;
-    users.extraGroups.systemd-network.gid = config.ids.gids.systemd-network;
-
     systemd.services.systemd-networkd = {
       wantedBy = [ "multi-user.target" ];
       before = [ "network-interfaces.target" ];
diff --git a/nixos/modules/system/boot/resolved.nix b/nixos/modules/system/boot/resolved.nix
index ecd547322d3c..5a98b9b6d480 100644
--- a/nixos/modules/system/boot/resolved.nix
+++ b/nixos/modules/system/boot/resolved.nix
@@ -30,9 +30,6 @@ with lib;
       DNS=${concatStringsSep " " config.networking.nameservers}
     '';
 
-    users.extraUsers.systemd-resolve.uid = config.ids.uids.systemd-resolve;
-    users.extraGroups.systemd-resolve.gid = config.ids.gids.systemd-resolve;
-
   };
 
 }
diff --git a/nixos/modules/system/boot/systemd.nix b/nixos/modules/system/boot/systemd.nix
index d1e97e0b87f0..2a32c963e970 100644
--- a/nixos/modules/system/boot/systemd.nix
+++ b/nixos/modules/system/boot/systemd.nix
@@ -649,6 +649,11 @@ in
         ${pkgs.acl}/bin/setfacl -nm g:wheel:rx,d:g:wheel:rx,g:adm:rx,d:g:adm:rx /var/log/journal || true
       '';
 
+    users.extraUsers.systemd-network.uid = config.ids.uids.systemd-network;
+    users.extraGroups.systemd-network.gid = config.ids.gids.systemd-network;
+    users.extraUsers.systemd-resolve.uid = config.ids.uids.systemd-resolve;
+    users.extraGroups.systemd-resolve.gid = config.ids.gids.systemd-resolve;
+
     # Target for ‘charon send-keys’ to hook into.
     users.extraGroups.keys.gid = config.ids.gids.keys;