nixos: added nix-helper

This commit is contained in:
Tigor Hutasuhut 2024-08-28 19:30:25 +07:00
parent 03d35a039a
commit 8074e9f01e
2 changed files with 25 additions and 8 deletions

View file

@ -30,8 +30,10 @@ in
shellAliases = { shellAliases = {
ls = "${pkgs.eza}/bin/eza -lah"; ls = "${pkgs.eza}/bin/eza -lah";
cat = "${pkgs.bat}/bin/bat"; cat = "${pkgs.bat}/bin/bat";
update = "sudo nixos-rebuild switch --flake $HOME/dotfiles"; # update = "sudo nixos-rebuild switch --flake $HOME/dotfiles";
superupdate = "(cd $HOME/dotfiles && nix flake update && sudo nixos-rebuild switch --flake $HOME/dotfiles)"; update = "nh os switch";
# superupdate = "(cd $HOME/dotfiles && nix flake update && sudo nixos-rebuild switch --flake $HOME/dotfiles)";
superupdate = "nh os switch --update";
lg = "${pkgs.lazygit}/bin/lazygit"; lg = "${pkgs.lazygit}/bin/lazygit";
du = "${pkgs.dust}/bin/dust"; du = "${pkgs.dust}/bin/dust";
uptest = "sudo nixos-rebuild test --flake $HOME/dotfiles"; uptest = "sudo nixos-rebuild test --flake $HOME/dotfiles";

View file

@ -1,4 +1,4 @@
{ hardware-configuration, profile-path, config, ... }: { hardware-configuration, profile-path, config, pkgs, ... }:
{ {
imports = [ imports = [
profile-path profile-path
@ -25,11 +25,11 @@
connect-timeout = 5 connect-timeout = 5
''; '';
nix.gc = { # nix.gc = {
automatic = true; # automatic = true;
dates = "weekly"; # dates = "weekly";
options = "--delete-older-than 7d"; # options = "--delete-older-than 7d";
}; # };
i18n.defaultLocale = "en_US.UTF-8"; i18n.defaultLocale = "en_US.UTF-8";
@ -65,4 +65,19 @@
RestartSec = "10s"; RestartSec = "10s";
}; };
}; };
programs.nh = {
enable = true;
clean.enable = true;
clean.extraArgs = "--keep-since 4d --keep 3";
flake = "/home/${config.profile.user.name}/dotfiles";
};
environment.variables.FLAKE = "/home/${config.profile.user.name}/dotfiles";
environment.systemPackages = with pkgs; [
# Tools for nh
nix-output-monitor
nvd
];
} }