huge
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
set unstable
|
||||
flake_path := "/etc/nixos"
|
||||
flake_path := "path:/etc/nixos"
|
||||
|
||||
privesc := if which("sudo") != "" {
|
||||
"sudo"
|
||||
@@ -13,22 +13,35 @@ privesc := if which("sudo") != "" {
|
||||
error("No privilege escalation tool found")
|
||||
}
|
||||
|
||||
alias b := build
|
||||
alias sw := switch
|
||||
alias up := update
|
||||
alias upp := update-input
|
||||
alias gc := collect-garbage
|
||||
alias ca := clean-all
|
||||
|
||||
default:
|
||||
@just --list
|
||||
|
||||
# Rebuild and switch
|
||||
[group('nix')]
|
||||
sw:
|
||||
nh os switch {{flake_path}}
|
||||
build:
|
||||
nh os build {{flake_path}}
|
||||
@rm -f result
|
||||
|
||||
# Don't want to enter password 3 times with doas/run0
|
||||
[group('nix')]
|
||||
switch:
|
||||
{{privesc}} nixos-rebuild switch --flake {{flake_path}}
|
||||
|
||||
# Update and switch
|
||||
[group('nix')]
|
||||
up:
|
||||
update:
|
||||
nh os switch --update {{flake_path}}
|
||||
|
||||
# Update specific input: `just upp nixpkgs`
|
||||
[group('nix')]
|
||||
upp input:
|
||||
update-input input:
|
||||
nix flake update {{input}}
|
||||
|
||||
# Test
|
||||
@@ -38,12 +51,12 @@ test:
|
||||
|
||||
# Collect garbage
|
||||
[group('nix')]
|
||||
gc:
|
||||
collect-garbage:
|
||||
nix-collect-garbage --delete-old
|
||||
{{privesc}} nix-collect-garbage -d
|
||||
{{privesc}} /run/current-system/bin/switch-to-configuration boot
|
||||
|
||||
# Run `nh clean all`
|
||||
[group('nix')]
|
||||
ca:
|
||||
clean-all:
|
||||
nh clean all
|
||||
|
||||
Reference in New Issue
Block a user