NixOS-Configs/makefile
2024-06-30 09:46:49 -05:00

48 lines
1 KiB
Makefile

HOSTNAME := $(shell hostname -s)
UNAME_S := $(shell uname -s)
UNAME_M := $(shell uname -m)
all: switch
switch: prep
doas nixos-rebuild switch --flake .#${HOSTNAME} &> nixos-switch.log || ( grep --color error nixos-switch.log && false)
weekly: pull clean update switch ci push clean
cweekly: clean pull switch clean
update:
nix flake update
clean:
home-manager expire-generations "-5 days"
doas nix-collect-garbage --quiet --log-format bar --no-build-output --delete-old
doas nix store optimise
push:
@. ~/.bash_ssh
git push
pull:
@. ~/.bash_ssh
git pull
doas nix-prefetch-url file://$$PWD/$$(ls -1 src/linuxx64* | tail -n1)
# doas nix-prefetch-url file://$$PWD/$$(ls -1 src/linuxarm64* | tail -n1)
ci:
git commit -m"updates from makefile" --all
check:
@nix flake check --show-trace $(ARGS)
flaketest:
@nix run "github:DeterminateSystems/flake-checker"
test: check
doas nixos-rebuild dry-build --flake ./#$(HOSTNAME)
prep:
@locate home-manager-backup | sort -u | xargs rm -f
reboot:
@doas reboot