From c01b4e2dbeb7adf710296849dff3006d39696742 Mon Sep 17 00:00:00 2001 From: Benedikt Peetz Date: Wed, 25 Dec 2024 18:45:14 +0100 Subject: fix(modules/dhcpcd): Also set uid/gid for the `dhcpcd` user Otherwise, this user's/group's owned files/directories could change when a new user is added or removed, as we do not persist `/var/lib/nixos`. --- modules/by-name/dh/dhcpcd/module.nix | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 modules/by-name/dh/dhcpcd/module.nix diff --git a/modules/by-name/dh/dhcpcd/module.nix b/modules/by-name/dh/dhcpcd/module.nix new file mode 100644 index 0000000..0e35af3 --- /dev/null +++ b/modules/by-name/dh/dhcpcd/module.nix @@ -0,0 +1,18 @@ +{ + config, + lib, + ... +}: let + cfg = config.vhack.dhcpcd; +in { + options.vhack.dhcpcd = { + enable = (lib.mkEnableOption "dhcpcd") // {default = config.networking.dhcpcd.enable;}; + }; + + config = lib.mkIf cfg.enable { + users = { + users.dhcpcd.uid = config.vhack.constants.ids.uids.dhcpcd; + groups.dhcpcd.gid = config.vhack.constants.ids.gids.dhcpcd; + }; + }; +} -- cgit 1.4.1