feat: use nh (yet another nix helper)
This commit is contained in:
16
Makefile
16
Makefile
@@ -2,15 +2,19 @@ all: fmt switch
|
||||
|
||||
switch:
|
||||
@echo "Rebuilding NixOS..."
|
||||
@nixos-rebuild switch --flake . --sudo --json |& nom
|
||||
@nh os switch .
|
||||
|
||||
boot:
|
||||
@echo "Rebuilding NixOS..."
|
||||
@nixos-rebuild boot --flake . --sudo --json |& nom
|
||||
@nh os boot .
|
||||
|
||||
test:
|
||||
@echo "Rebuilding NixOS..."
|
||||
@nh os test .
|
||||
|
||||
vm:
|
||||
@echo "Building NixOS VM..."
|
||||
@nixos-rebuild build-vm --flake . --json |& nom
|
||||
@nh os build-vm .
|
||||
|
||||
update:
|
||||
@echo "Updating flakes..."
|
||||
@@ -23,17 +27,17 @@ replpkgs:
|
||||
@nix repl -f flake:nixpkgs
|
||||
|
||||
repl:
|
||||
@nixos-rebuild repl --flake .
|
||||
@nh os repl .
|
||||
|
||||
cleandry:
|
||||
@echo "Listing all generations older than 15 days..."
|
||||
@sudo nix profile wipe-history --profile /nix/var/nix/profiles/system --dry-run --older-than 15d
|
||||
@nix run home-manager#home-manager -- expire-generations -15days --dry-run
|
||||
@nix profile wipe-history --profile ~/.local/state/nix/profiles/home-manager --dry-run --older-than 15d
|
||||
|
||||
clean:
|
||||
@echo "Removing all generations older than 15 days..."
|
||||
@sudo nix profile wipe-history --profile /nix/var/nix/profiles/system --older-than 15d
|
||||
@nix run home-manager#home-manager -- expire-generations -15days
|
||||
@nix profile wipe-history --profile ~/.local/state/nix/profiles/home-manager --older-than 15d
|
||||
|
||||
gc:
|
||||
@nix store gc --debug
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
inputs,
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
lib.my.makeSwitch {
|
||||
@@ -20,6 +21,11 @@ lib.my.makeSwitch {
|
||||
# Making legacy nix commands consistent as well, awesome!
|
||||
nix.nixPath = [ "/etc/nix/path" ];
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
nix-output-monitor
|
||||
nh
|
||||
];
|
||||
|
||||
environment.etc = lib.mapAttrs' (name: value: {
|
||||
name = "nix/path/${name}";
|
||||
value.source = value.flake;
|
||||
|
||||
Reference in New Issue
Block a user