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