Skip to content

Commit 528ce52

Browse files
eapolinarioclaude
andcommitted
feat(nixos): add Makefile for switch and deploy targets
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 405ad90 commit 528ce52

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

nixos/Makefile

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
HOST ?= fusion-vm
2+
TARGET ?= eduardo@192.168.4.85
3+
FLAKE_DIR = $(shell pwd)
4+
5+
.PHONY: switch deploy fmt help
6+
7+
## switch: rebuild and switch the config on the target host (ssh)
8+
switch:
9+
ssh $(TARGET) "cd ~/dotfiles/nixos && sudo nixos-rebuild switch --flake .#$(HOST)"
10+
11+
## deploy: full nixos-anywhere install (first-time, wipes disk)
12+
deploy:
13+
bash $(FLAKE_DIR)/deploy.sh $(HOST) $(TARGET)
14+
15+
## fmt: format all nix files
16+
fmt:
17+
nix fmt $(FLAKE_DIR)
18+
19+
## help: show this help
20+
help:
21+
@grep -E '^## ' Makefile | sed 's/## //'

0 commit comments

Comments
 (0)