diff options
| author | Michael Hoang <enzime@users.noreply.github.com> | 2024-11-03 19:53:20 +1100 |
|---|---|---|
| committer | Michael Hoang <enzime@users.noreply.github.com> | 2024-11-07 17:20:00 +1100 |
| commit | cf130aa9579fc1708ff4a265d2108eefa535e9b2 (patch) | |
| tree | 488c1b92140bed7cf415799d14b961e2c6ebdb03 /modules/users | |
| parent | 32814a6eb1de3b564ff43e5b6453637b1eb25721 (diff) | |
users: don't generate `ensurePerms` when no users to manage
Diffstat (limited to 'modules/users')
| -rw-r--r-- | modules/users/default.nix | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/modules/users/default.nix b/modules/users/default.nix index 4044732..434b1da 100644 --- a/modules/users/default.nix +++ b/modules/users/default.nix @@ -111,7 +111,7 @@ in # NOTE: We put this in `system.checks` as we want this to run first to avoid partial activations # however currently that runs at user level activation as that runs before system level activation # TODO: replace `$USER` with `$SUDO_USER` when system.checks runs from system level - system.checks.text = lib.mkAfter '' + system.checks.text = lib.mkIf (builtins.length (createdUsers ++ deletedUsers) > 0) (lib.mkAfter '' ensurePerms() { homeDirectory=$(dscl . -read /Users/nobody NFSHomeDirectory) homeDirectory=''${homeDirectory#NFSHomeDirectory: } @@ -157,7 +157,6 @@ in fi } - ${concatMapStringsSep "\n" (v: let name = lib.escapeShellArg v.name; dsclUser = lib.escapeShellArg "/Users/${v.name}"; @@ -204,7 +203,7 @@ in fi fi '') deletedUsers} - ''; + ''); system.activationScripts.groups.text = mkIf (cfg.knownGroups != []) '' echo "setting up groups..." >&2 |
