70 lines
1.9 KiB
Makefile
70 lines
1.9 KiB
Makefile
HOSTNAME := $(shell hostname -s)
|
|
UNAME_S := $(shell uname -s)
|
|
UNAME_M := $(shell uname -m)
|
|
|
|
all: test
|
|
|
|
test:
|
|
@alejandra . &> nixos-switch.log || ( cat nixos-switch.log && false)
|
|
@colmena build --on $(HOSTNAME)
|
|
|
|
switch: prep
|
|
@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 -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)
|
|
|
|
weekly: pull clean update switch ci push clean
|
|
|
|
cweekly: clean pull switch clean
|
|
|
|
update:
|
|
@echo "Updating flake.lock"
|
|
@nix flake update &> nixos-switch.log || ( cat nixos-switch.log && false)
|
|
@rm -f nixos-switch.log
|
|
|
|
clean:
|
|
@echo "Cleaning old entries and store"
|
|
@home-manager expire-generations "-5 days"
|
|
@doas nix-collect-garbage --quiet --log-format bar --no-build-output --delete-old
|
|
@doas nix store optimise
|
|
|
|
push:
|
|
@echo pushing to git
|
|
@git push
|
|
|
|
pull:
|
|
@echo Updating from git repo
|
|
@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)
|
|
@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 -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 -f nixos-switch.log
|
|
|
|
prep:
|
|
@locate home-manager-backup | sort -u | xargs rm -f
|
|
|
|
reboot:
|
|
@doas reboot
|