Skip to content

Commit

Permalink
feat(fish): Delete old kernels with nix-clean function
Browse files Browse the repository at this point in the history
  • Loading branch information
mrjones2014 committed Apr 2, 2024
1 parent a4ce528 commit eadff5c
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions home-manager/modules/fish.nix
Original file line number Diff line number Diff line change
Expand Up @@ -115,15 +115,17 @@ in {
body = "cd $HOME/git && git clone $argv && cd $(basename $argv .git)";
};
nix-clean = ''
# NixOS-specific steps
if test -f /etc/NIXOS
sudo nix-env -p /nix/var/nix/profiles/system --delete-generations +3
for link in /nix/var/nix/gcroots/auto/*
rm $(readlink "$link")
end
end
nix-env --delete-generations old
nix-store --gc
nix-channel --update
nix-env -u --always
if test -f /etc/NIXOS
for link in /nix/var/nix/gcroots/auto/*
rm $(readlink "$link")
end
end
nix-collect-garbage -d
'';
groot = {
Expand Down

0 comments on commit eadff5c

Please sign in to comment.