use `nh` as a nixos-rebuild wrapper with nice output
Alan Pearce alan@alanpearce.eu
Mon, 29 Apr 2024 20:10:36 +0200
5 files changed, 17 insertions(+), 6 deletions(-)
M system/settings/configuration/nix.nix → system/settings/configuration/nix.nix
@@ -1,4 +1,5 @@ { config +, lib , pkgs , ... }: { @@ -22,7 +23,7 @@ warn-dirty = false ''; gc = { - automatic = true; + automatic = lib.mkDefault true; options = "--delete-older-than 14d"; }; };
M system/settings/user-interface.nix → system/settings/user-interface.nix
@@ -61,6 +61,15 @@ }; programs.dconf.enable = true; + programs.nh = { + enable = true; + clean = { + enable = true; + extraArgs = "--keep-since 14d"; + }; + }; + nix.gc.automatic = ! config.programs.nh.enable; + imports = [ ./services/xserver.nix ];
M user/settings/fish.nix → user/settings/fish.nix
@@ -25,7 +25,7 @@ } ]; # TODO: pre-generate nix-your-shell interactiveShellInit = '' - ${pkgs.nix-your-shell}/bin/nix-your-shell fish | source + ${pkgs.nix-your-shell}/bin/nix-your-shell --nom env fish | source bind \es __ghq_repository_search # don't bind ctrl-t, it does nice things on macOS/BSD set FZF_CTRL_T_COMMAND
M user/settings/nixos.nix → user/settings/nixos.nix
@@ -5,9 +5,9 @@ ./nixpkgs.nix ]; home.shellAliases = { - srb = "sudo nixos-rebuild"; - rbs = "sudo nixos-rebuild switch --fast"; - rbb = "sudo nixos-rebuild boot"; - rbr = "sudo nixos-rebuild switch --rollback"; + srb = "nh os"; + rbs = "nh os switch --fast"; + rbb = "nh os boot"; + rbr = "nh os switch --rollback"; }; }