[NixOS] Programatically get the list of users
This commit is contained in:
parent
0f65575a35
commit
a75824ee2a
@ -1,7 +1,6 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
users=("root" "imalison" "kat" "dean" "alex" "will" "mike")
|
for user in $(awk -F':' '{ if ($3 >= 1000 && $7 !~ /nologin|false|sync|shutdown|halt/) print $1 }' /etc/passwd); do
|
||||||
|
echo $user
|
||||||
for user in "${users[@]}"; do
|
sudo su - $user -c 'home-manager expire-generations -1days'
|
||||||
sudo su - $user -c 'home-manager expire-generations -15days'
|
|
||||||
done
|
done
|
||||||
|
Loading…
Reference in New Issue
Block a user