dotfiles/nixos/expire-home-manager-generations.sh

7 lines
221 B
Bash
Raw Normal View History

#!/usr/bin/env bash
for user in $(awk -F':' '{ if ($3 >= 1000 && $7 !~ /nologin|false|sync|shutdown|halt/) print $1 }' /etc/passwd); do
echo $user
sudo su - $user -c 'home-manager expire-generations -1days'
done