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