mirror of
https://github.com/lightly-toasted/nix-config.git
synced 2026-01-31 12:40:24 +00:00
feat: add nh
- Updated justfile to use nh for deploy commands - Added nh to flake devShell - Added nh and just to shell.nix - Enabled programs.nh in nixos
This commit is contained in:
parent
f2a6dee669
commit
213ce6601f
5 changed files with 23 additions and 10 deletions
|
|
@ -90,6 +90,7 @@
|
||||||
pkgs.git
|
pkgs.git
|
||||||
pkgs.git-crypt
|
pkgs.git-crypt
|
||||||
pkgs.just
|
pkgs.just
|
||||||
|
pkgs.nh
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -10,5 +10,6 @@
|
||||||
./ydotool.nix
|
./ydotool.nix
|
||||||
./steam.nix
|
./steam.nix
|
||||||
./nix-ld.nix
|
./nix-ld.nix
|
||||||
|
./nh.nix
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
|
||||||
8
hosts/nixos/modules/programs/nh.nix
Normal file
8
hosts/nixos/modules/programs/nh.nix
Normal file
|
|
@ -0,0 +1,8 @@
|
||||||
|
{
|
||||||
|
programs.nh = {
|
||||||
|
enable = true;
|
||||||
|
clean.enable = true;
|
||||||
|
clean.extraArgs = "--keep-since 7d --keep 3";
|
||||||
|
flake = "/home/toast/nix-config";
|
||||||
|
};
|
||||||
|
}
|
||||||
21
justfile
21
justfile
|
|
@ -3,19 +3,20 @@
|
||||||
default:
|
default:
|
||||||
@just --list
|
@just --list
|
||||||
|
|
||||||
deploy-nixos:
|
_check-nh:
|
||||||
sudo nixos-rebuild switch --flake .#$(hostname)
|
@command -v nh > /dev/null 2>&1 || echo "nh is not in PATH. Run 'nix develop' first."
|
||||||
|
|
||||||
deploy-vps:
|
deploy-nixos: _check-nh
|
||||||
nixos-rebuild switch --flake .#vps --target-host root@vps
|
nh os switch .
|
||||||
|
|
||||||
deploy-home:
|
deploy-vps: _check-nh
|
||||||
home-manager switch --flake .#$USER@$(hostname)
|
nh os switch . -H vps --target-host root@vps
|
||||||
|
|
||||||
|
deploy-home: _check-nh
|
||||||
|
nh home switch .
|
||||||
|
|
||||||
update:
|
update:
|
||||||
nix flake update --commit-lock-file
|
nix flake update --commit-lock-file
|
||||||
|
|
||||||
gc:
|
gc: _check-nh
|
||||||
nix-collect-garbage -d
|
nh clean all --keep-since 7d
|
||||||
nix-collect-garbage --delete-older-than 7d
|
|
||||||
nix-store --gc
|
|
||||||
|
|
|
||||||
|
|
@ -7,5 +7,7 @@ pkgs.mkShell {
|
||||||
git
|
git
|
||||||
sops
|
sops
|
||||||
git-crypt
|
git-crypt
|
||||||
|
just
|
||||||
|
nh
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue