1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
SERVERS := g1-bigscreen
default: servers
all: servers
.PHONY: default all infra servers local dry-local
# Servers
servers: $(SERVERS)
$(SERVERS): %:
rsync --delete -ravP --filter=':- .gitignore' --exclude='.git' . $@:/etc/nixos
rsync --delete -ravP state $@:/etc/nixos/
ssh -t $@ "tmux new-session -s rebuild 'cd /etc/nixos && rm -rf .git && nixos-rebuild switch --flake .; echo \"--- done ---\"; read;'"
$(addprefix dry-,$(SERVERS)): %:
rsync --delete -ravP --filter=':- .gitignore' --exclude='.git' . ${subst dry-,,$@}:/etc/nixos/dry
rsync --delete -ravP state ${subst dry-,,$@}:/etc/nixos/dry
ssh -t ${subst dry-,,$@} "tmux new-session -s rebuild 'cd /etc/nixos/dry && rm -rf .git && nixos-rebuild dry-activate --flake .; echo \"--- done ---\"; read;'"
$(addprefix vm-,$(SERVERS)): %:
nix build .#nixosConfigurations.${subst vm-,,$@}.config.system.build.vm
./result/bin/run-${subst vm-,,$@}-vm
$(addprefix build-,$(SERVERS)): %:
nix build .#nixosConfigurations.${subst build-,,$@}.config.system.build.toplevel
$(addprefix tree-,$(SERVERS)): %:
nix build .#nixosConfigurations.${subst tree-,,$@}.config.system.build.toplevel
nix-tree ./result
|