diff options
author | tcmal <me@aria.rip> | 2024-08-23 01:03:50 +0100 |
---|---|---|
committer | tcmal <me@aria.rip> | 2024-08-23 01:05:10 +0100 |
commit | 5028503d6d2a21d9e4cb3100a2f9b2795cb5d4bd (patch) | |
tree | 94f38bbdfabc7b2549b97541b4d9880b5eb332e7 /Makefile |
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..da3a9ce --- /dev/null +++ b/Makefile @@ -0,0 +1,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 |