justfile | formating, and added oldschool to call nixos-rebuild directly

This commit is contained in:
Don Harper 2025-01-02 23:02:07 -06:00
parent 77c458ff10
commit 61bab0ffe7

View file

@ -2,7 +2,7 @@ HOSTNAME := `hostname -s`
# Do as test build without installing
test hostname=(HOSTNAME):
@nixfmt . &> nixos-switch.log || ( cat nixos-switch.log && false)
@nixfmt . &> nixos-switch.log || ( cat nixos-switch.log && false )
@rm -f nixos-switch.log
@colmena --impure build --on {{hostname}}
@ -34,7 +34,7 @@ web:
# Build and run a vm FIXME
vm hostname=(HOSTNAME):
@doas rm -f result
@nixfmt . &> nixos-switch.log || ( cat nixos-switch.log && false)
@nixfmt . &> nixos-switch.log || ( cat nixos-switch.log && false )
@rm -f nixos-switch.log
@echo Running iso build
@nixos-rebuild build-vm --flake .#{{hostname}}
@ -42,10 +42,10 @@ vm hostname=(HOSTNAME):
result/bin/run-{{hostname}}-vm
bootiso:
@nixfmt . &> nixos-switch.log || ( cat nixos-switch.log && false)
@nixfmt . &> nixos-switch.log || ( cat nixos-switch.log && false )
@rm -f nixos-switch.log result
@echo Running iso build
@doas nix build --impure ./#nixosConfigurations.vm.config.system.build.isoImage &> nixos-switch.log || ( grep -E --color '(error|For full logs)' nixos-switch.log && false)
@doas nix build --impure ./#nixosConfigurations.vm.config.system.build.isoImage &> nixos-switch.log || ( grep -E --color '(error|For full logs)' nixos-switch.log && false )
# Stuff to do weekly
weekly: pull clean update world ci push clean-world
@ -53,7 +53,7 @@ weekly: pull clean update world ci push clean-world
# Update flake.lock
update:
@echo "Updating flake.lock"
@nix flake update &> nixos-switch.log || ( cat nixos-switch.log && false)
@nix flake update &> nixos-switch.log || ( cat nixos-switch.log && false )
@rm -f nixos-switch.log
# Clean up
@ -82,19 +82,24 @@ push:
# Pull changes from git
pull:
@echo Updating from git repo
@git pull &> nixos-switch.log || ( cat nixos-switch.log && false)
@git pull &> nixos-switch.log || ( cat nixos-switch.log && false )
@rm -f nixos-switch.log
@doas nix-prefetch-url file://`pwd`/`ls -1 src/linuxx64* | tail -n1` &> nixos-switch.log || ( cat nixos-switch.log && false)
@doas nix-prefetch-url file://`pwd`/`ls -1 src/linuxx64* | tail -n1` &> nixos-switch.log || ( cat nixos-switch.log && false )
@rm -f nixos-switch.log
# @doas nix-prefetch-url file://`pwd`/`ls -1 src/linuxarm64* | tail -n1` &> nixos-switch.log || ( cat nixos-switch.log && false)
# @doas nix-prefetch-url file://`pwd`/`ls -1 src/linuxarm64* | tail -n1` &> nixos-switch.log || ( cat nixos-switch.log && false )
# @rm -f nixos-switch.log
# Add everything to git
ci:
@echo "git commit"
@git commit -m"chore | Update flake.lock" flake.lock &> nixos-switch.log || ( cat nixos-switch.log && false)
@git commit -m"chore | Update flake.lock" flake.lock &> nixos-switch.log || ( cat nixos-switch.log && false )
@rm -f nixos-switch.log
# Go old school
oldschool:
@nixfmt . &> nixos-switch.log || ( cat nixos-switch.log && false )
@rm -f nixos-switch.log
@doas nixos-rebuild switch --flake .#{{HOSTNAME}}
# Reboot this host
reboot: