nixos: add nh and use it's gc

This commit is contained in:
Alexandre Cavalheiro S. Tiago da Silva 2024-07-04 15:42:55 -03:00
parent 122997fb82
commit 9c5008a965
Signed by: wizardlink
GPG key ID: A5767B54367CFBDF
2 changed files with 9 additions and 17 deletions

View file

@ -24,11 +24,15 @@
"flakes"
];
# Enable nh, a bundle of CLI utilities for NixOS
programs.nh = {
enable = true;
# Enable automatic garbage collection.
nix.gc = {
automatic = true;
dates = "weekly";
options = "--delete-older-than 1w";
clean.enable = true;
clean.extraArgs = "--keep-since 4d --keep 3";
flake = "/home/wizardlink/.system";
};
# Optimize storage

12
switch
View file

@ -1,12 +0,0 @@
#!/etc/profiles/per-user/wizardlink/bin/fish
function build
sudo nixos-rebuild switch --flake ~/.system\#nixos $argv[1]
end
if test "--fast" = "$argv[1]"
build --fast
else
build
end