NH and herdr

This commit is contained in:
2026-07-04 14:15:22 +02:00
parent e9c9670de2
commit 1ad01c35da
3 changed files with 51 additions and 7 deletions
+10 -4
View File
@@ -1,4 +1,4 @@
{config, pkgs, ...}:
{config, pkgs, herdr, ...}:
{
imports = [ ./niri.nix ];
@@ -15,7 +15,7 @@
shellAliases = {
n = "nvim";
rebuild = "sudo nixos-rebuild switch --flake ~/nixos-dotfiles";
upgrade = "nix flake update --flake ~/nixos-dotfiles && sudo nixos-rebuild switch --flake ~/nixos-dotfiles";
upgrade = "nix flake update --flake ~/nixos-dotfiles && { command -v nh > /dev/null 2>&1 && nh os switch ~/nixos-dotfiles || sudo nixos-rebuild switch --flake ~/nixos-dotfiles; }";
};
};
@@ -31,7 +31,7 @@
shellAliases = {
n = "nvim";
rebuild = "sudo nixos-rebuild switch --flake ~/nixos-dotfiles";
upgrade = "nix flake update --flake ~/nixos-dotfiles && sudo nixos-rebuild switch --flake ~/nixos-dotfiles";
upgrade = "nix flake update --flake ~/nixos-dotfiles && { command -v nh &>/dev/null && nh os switch ~/nixos-dotfiles || sudo nixos-rebuild switch --flake ~/nixos-dotfiles; }";
tree = "eza --tree --level=2";
ls = "eza --icons --all --header --long --git";
};
@@ -54,7 +54,11 @@
bindkey "^[OB" down-line-or-beginning-search
function gc() {
sudo nix-collect-garbage --delete-older-than "''${1:-14}d"
if command -v nh &>/dev/null; then
nh clean all --keep-since "''${1:-14}d"
else
sudo nix-collect-garbage --delete-older-than "''${1:-14}d"
fi
}
function mkenv() {
@@ -261,6 +265,7 @@
# ── Packages ─────────────────────────────────────────────────────────────────
home.packages = with pkgs; [
# general
herdr.packages.${pkgs.system}.default # wallpaper manager
claude-code # ai coding assistant
azure-cli # az cli
git-credential-manager # git credential helper (azure devops PAT)
@@ -270,6 +275,7 @@
jq # json processor
powershell # yes
teams-for-linux # teams
nh # nix helper
unzip # compression
# terminal