diff options
author | Adam Stephens <adam@valkor.net> | 2024-03-21 13:47:15 -0400 |
---|---|---|
committer | Adam Stephens <adam@valkor.net> | 2024-03-21 13:47:15 -0400 |
commit | 564c3749d90b865df2b978482659d73fe7ee2e7c (patch) | |
tree | 471c086412b72d3cc26b0cf3d2cf7280b2fd0379 | |
parent | c2684b4d2d650dce7923a7e5d44ad7b8fa44aefd (diff) |
nixos/users-groups: fix broken linger
-rw-r--r-- | nixos/modules/config/users-groups.nix | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/nixos/modules/config/users-groups.nix b/nixos/modules/config/users-groups.nix index 02cd1a17f538..2fbb37625805 100644 --- a/nixos/modules/config/users-groups.nix +++ b/nixos/modules/config/users-groups.nix @@ -704,8 +704,9 @@ in { in stringAfter [ "users" ] '' if [ -e ${lingerDir} ] ; then cd ${lingerDir} - for user in ${lingerDir}/*; do - if ! id "$user" >/dev/null 2>&1; then + for user in $(ls); do + if ! id "$user" >/dev/null; then + echo "Removing linger for deleted user $user" rm --force -- "$user" fi done |