task | clean up make file and covert to use colmena

This commit is contained in:
Don Harper 2024-09-25 07:34:02 -05:00
parent 47425ad6dd
commit 0e977c897f

View file

@ -2,20 +2,33 @@ HOSTNAME := $(shell hostname -s)
UNAME_S := $(shell uname -s)
UNAME_M := $(shell uname -m)
all: switch
all: test
test:
@alejandra . &> nixos-switch.log || ( cat nixos-switch.log && false)
@colmena build --on $(HOSTNAME)
switch: prep
@alejandra . &> nixos-switch.log || ( cat nixos-switch.log && false)
@rm nixos-switch.log
@echo Running nixos-rebuild switch
@doas nixos-rebuild switch --flake .#${HOSTNAME} &> nixos-switch.log || ( grep -E --color '(error|For full logs)' nixos-switch.log && false)
@rm -f nixos-switch.log
@colmena apply --on ${HOSTNAME}
world: prep
@rm -f nixos-switch.log
@colmena apply
workstation: prep
@rm -f nixos-switch.log
@colmena apply --on @workstation
server: prep
@rm -f nixos-switch.log
@colmena apply --on @server
vm:
@alejandra . &> nixos-switch.log || ( cat nixos-switch.log && false)
@rm nixos-switch.log
@rm -f nixos-switch.log
@echo Running iso build
@nix build --impure ./#nixosConfigurations.vm.config.system.build.isoImage
&> nixos-switch.log || ( grep -E --color '(error|For full logs)' nixos-switch.log && false)
@nix build --impure ./#nixosConfigurations.vm.config.system.build.isoImage &> nixos-switch.log || ( grep -E --color '(error|For full logs)' nixos-switch.log && false)
weekly: pull clean update switch ci push clean
@ -24,7 +37,7 @@ cweekly: clean pull switch clean
update:
@echo "Updating flake.lock"
@nix flake update &> nixos-switch.log || ( cat nixos-switch.log && false)
@rm nixos-switch.log
@rm -f nixos-switch.log
clean:
@echo "Cleaning old entries and store"
@ -39,31 +52,16 @@ push:
pull:
@echo Updating from git repo
@git pull &> nixos-switch.log || ( cat nixos-switch.log && false)
@rm nixos-switch.log
@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)
@rm nixos-switch.log
@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)
@ # rm nixos-switch.log
@ # rm -f nixos-switch.log
ci:
@echo "git commit all"
@git commit -m"updates from makefile" --all &> nixos-switch.log || ( cat nixos-switch.log && false)
@rm nixos-switch.log
check:
@echo "running flake check"
@nix flake check --show-trace $(ARGS) &> nixos-switch.log || ( cat nixos-switch.log && false)
@rm nixos-switch.log
flaketest:
@echo running flake-checker
@nix run "github:DeterminateSystems/flake-checker" &> nixos-switch.log || ( cat nixos-switch.log && false)
@rm nixos-switch.log
test: check
@echo "nixos-rebuild dryrun"
@doas nixos-rebuild dry-build --flake ./#$(HOSTNAME) &> nixos-switch.log || ( cat nixos-switch.log && false)
@rm nixos-switch.log
@rm -f nixos-switch.log
prep:
@locate home-manager-backup | sort -u | xargs rm -f