27 lines
484 B
Makefile
27 lines
484 B
Makefile
HOST ?= $(shell hostname)
|
|
HOSTS = solo c2
|
|
|
|
.PHONY: all switch $(addprefix, _swtich_,${HOSTS}) _swtich_
|
|
.SUFFIXES:
|
|
|
|
all:
|
|
@echo "Run \`make switch\` as root to rebuild and switch"
|
|
@true
|
|
|
|
switch: _switch_${HOST}
|
|
|
|
apply:
|
|
colmena apply
|
|
|
|
update-hidden:
|
|
nix flake update nixos-config-hidden
|
|
|
|
_switch_:
|
|
@echo "ERROR: couldn't find hostname"
|
|
@false
|
|
_switch_%:
|
|
@if [ "$(shell whoami)" != "root" ]; then \
|
|
echo "ERROR: Run as root!"; \
|
|
false; \
|
|
fi
|
|
nixos-rebuild switch --flake .#$*
|