From 9c5008a9657c1fa49a14730cd20b64c2299b75d3 Mon Sep 17 00:00:00 2001 From: "Alexandre Cavalheiro S. Tiago da Silva" Date: Thu, 4 Jul 2024 15:42:55 -0300 Subject: [PATCH] nixos: add nh and use it's gc --- nixos.nix | 14 +++++++++----- switch | 12 ------------ 2 files changed, 9 insertions(+), 17 deletions(-) delete mode 100755 switch diff --git a/nixos.nix b/nixos.nix index 9c18a15..c853b2f 100644 --- a/nixos.nix +++ b/nixos.nix @@ -24,11 +24,15 @@ "flakes" ]; - # Enable automatic garbage collection. - nix.gc = { - automatic = true; - dates = "weekly"; - options = "--delete-older-than 1w"; + # Enable nh, a bundle of CLI utilities for NixOS + programs.nh = { + enable = true; + + # Enable automatic garbage collection. + clean.enable = true; + clean.extraArgs = "--keep-since 4d --keep 3"; + + flake = "/home/wizardlink/.system"; }; # Optimize storage diff --git a/switch b/switch deleted file mode 100755 index dc20a6f..0000000 --- a/switch +++ /dev/null @@ -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 -