justfile | aliased up nix command
This commit is contained in:
parent
11bae97b89
commit
a921480867
1 changed files with 6 additions and 5 deletions
11
justfile
11
justfile
|
|
@ -1,4 +1,5 @@
|
||||||
HOSTNAME := `hostname -s`
|
HOSTNAME := `hostname -s`
|
||||||
|
nixcmd := "nix --extra-experimental-features flakes --extra-experimental-features nix-command"
|
||||||
|
|
||||||
# Do as test build without installing
|
# Do as test build without installing
|
||||||
test hostname=(HOSTNAME):
|
test hostname=(HOSTNAME):
|
||||||
|
|
@ -56,12 +57,12 @@ vm hostname=(HOSTNAME):
|
||||||
buildiso hostname:
|
buildiso hostname:
|
||||||
@rm -f nixos-switch.log result
|
@rm -f nixos-switch.log result
|
||||||
@echo Running iso build
|
@echo Running iso build
|
||||||
@NIXPKGS_ALLOW_UNFREE=1 nix run --impure nixpkgs#nixos-generators -- -f iso --flake .#{{hostname}} --system x86_64-linux -o ./{{hostname}}.sd &> nixos-switch.log || ( cat nixos-switch.log && false )
|
@NIXPKGS_ALLOW_UNFREE=1 {{nixcmd}} run --impure nixpkgs#nixos-generators -- -f iso --flake .#{{hostname}} --system x86_64-linux -o ./{{hostname}}.sd &> nixos-switch.log || ( cat nixos-switch.log && false )
|
||||||
|
|
||||||
buildsd hostname:
|
buildsd hostname:
|
||||||
@rm -f nixos-switch.log result
|
@rm -f nixos-switch.log result
|
||||||
@echo Running sd build
|
@echo Running sd build
|
||||||
@doas nix run nixpkgs#nixos-generators -- -f sd-aarch64 --flake .#{{hostname}} --system aarch64-linux -o ./{{hostname}}.sd &> nixos-switch.log || ( cat nixos-switch.log && false )
|
@doas {{nixcmd}} run nixpkgs#nixos-generators -- -f sd-aarch64 --flake .#{{hostname}} --system aarch64-linux -o ./{{hostname}}.sd &> nixos-switch.log || ( cat nixos-switch.log && false )
|
||||||
|
|
||||||
# Stuff to do weekly
|
# Stuff to do weekly
|
||||||
weekly: pull clean update world ci push clean-world
|
weekly: pull clean update world ci push clean-world
|
||||||
|
|
@ -69,7 +70,7 @@ weekly: pull clean update world ci push clean-world
|
||||||
# Update flake.lock
|
# Update flake.lock
|
||||||
update:
|
update:
|
||||||
@echo "Updating flake.lock"
|
@echo "Updating flake.lock"
|
||||||
@nix flake update &> nixos-switch.log || ( cat nixos-switch.log && false )
|
@{{nixcmd}} flake update &> nixos-switch.log || ( cat nixos-switch.log && false )
|
||||||
@rm -f nixos-switch.log
|
@rm -f nixos-switch.log
|
||||||
|
|
||||||
# Clean up
|
# Clean up
|
||||||
|
|
@ -81,7 +82,7 @@ clean hostname=(HOSTNAME):
|
||||||
@echo "Garbage Collection"
|
@echo "Garbage Collection"
|
||||||
@colmena --impure exec --on {{hostname}} nix-collect-garbage --quiet --log-format bar --no-build-output --delete-old
|
@colmena --impure exec --on {{hostname}} nix-collect-garbage --quiet --log-format bar --no-build-output --delete-old
|
||||||
@echo "Store optimise"
|
@echo "Store optimise"
|
||||||
@colmena --impure exec --on {{hostname}} nix store optimise
|
@colmena --impure exec --on {{hostname}} {{nixcmd}} store optimise
|
||||||
|
|
||||||
# Clean up the world
|
# Clean up the world
|
||||||
clean-world:
|
clean-world:
|
||||||
|
|
@ -91,7 +92,7 @@ clean-world:
|
||||||
@echo "Garbage Collection"
|
@echo "Garbage Collection"
|
||||||
@colmena --impure exec 'nix-collect-garbage --quiet --log-format bar --no-build-output --delete-old'
|
@colmena --impure exec 'nix-collect-garbage --quiet --log-format bar --no-build-output --delete-old'
|
||||||
@echo "Store optimise"
|
@echo "Store optimise"
|
||||||
@colmena --impure exec 'nix store optimise'
|
@colmena --impure exec '{{nixcmd}} store optimise'
|
||||||
|
|
||||||
# Push local changes to git
|
# Push local changes to git
|
||||||
push:
|
push:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue