nixpkgs/home/packages/custom/update-system/default.nix
Daniel Siepmann 60188ff1da
Remove nix-index
It is slow as hell and I don't think I need the benefits.
2022-05-30 09:53:59 +02:00

18 lines
475 B
Nix

{ writeShellApplication }:
writeShellApplication {
name = "custom-update-system";
text = ''
nix-channel --update
home-manager switch
home-manager expire-generations '-30 days'
nix-env --delete-generations +5
oldVersion=$(home-manager generations | head -n 2 | tail -n 1 | cut -d' ' -f 7)
newVersion=$(home-manager generations | head -n 1 | cut -d' ' -f 7)
nvd diff "$oldVersion" "$newVersion"
nix store gc
nix store optimise
'';
}