From 39abbf77467e3dcc09aef23c9e446e3a938ec1d9 Mon Sep 17 00:00:00 2001 From: Soispha Date: Mon, 3 Jul 2023 21:32:48 +0200 Subject: Fix(system/services/nix-sync): Generate user and group if set to default --- system/services/nix-sync/default.nix | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'system/services/nix-sync') diff --git a/system/services/nix-sync/default.nix b/system/services/nix-sync/default.nix index b4859a1..d0ca114 100644 --- a/system/services/nix-sync/default.nix +++ b/system/services/nix-sync/default.nix @@ -188,6 +188,23 @@ in { config = lib.mkIf cfg.enable { systemd.services = services; + users.users = + if cfg.user == "nix-sync" + then { + nix-sync = { + group = "${cfg.group}"; + isSystemUser = true; + }; + } + else lib.warnIf (cfg.user != "nix-sync") "The user (${cfg.user}) is not \"nix-sync\", thus you are responible for generating it."; + users.groups = + if cfg.group == "nix-sync" + then { + nix-sync = { + members = ["${cfg.user}"]; + }; + } + else lib.warnIf (cfg.group != "nix-sync") "The group (${cfg.group}) is not \"nix-sync\", thus you are responible for generating it."; }; } # vim: ts=2 -- cgit 1.4.1