Commit 9f52b597954f
Changed files (1)
Makefile
@@ -1,4 +1,30 @@
# Makefile for home
+HOSTS = $(shell nix flake show --json | yq '.nixosConfigurations.[] | key')
+HOSTS_BUILD = $(addprefix host/, $(addsuffix /build,$(HOSTS)))
+BUILDER_HOST = root@shikoku.home
+
+hosts: ${HOSTS_BUILD}
+ echo ${HOSTS_BUILD} ${HOSTS}
+
+host/%/build: FORCE
+ nix build .#nixosConfigurations.$*.config.system.build.toplevel --no-link
+host/%/boot: FORCE
+ nixos-rebuild --build-host ${BUILDER_HOST} --target-host root@$*.home --flake .#$* boot
+host/%/switch: FORCE
+ nixos-rebuild --build-host ${BUILDER_HOST} --target-host root@$*.home --flake .#$* switch
+
+boot:
+ sudo nixos-rebuild --flake .# boot
+switch:
+ sudo nixos-rebuild --flake .# switch
+dry-build:
+ sudo nixos-rebuild --flake .# dry-build
+build:
+ sudo nixos-rebuild --flake .# build
+
+FORCE:
+
+# Old – to be removed
# Variables
EMACS =
ifndef EMACS
@@ -17,21 +43,21 @@ all: switch
update:
nix-channel --update
-.PHONY: build
-build:
- ./bin/system build
-
-.PHONY: nixos-dry-build
-dry-build: setup
- ./bin/system dry-build
-
-.PHONY: switch
-switch:
- ./bin/system switch
-
-.PHONY: boot
-boot:
- ./bin/system boot
+# .PHONY: build
+# build:
+# ./bin/system build
+#
+# .PHONY: nixos-dry-build
+# dry-build: setup
+# ./bin/system dry-build
+#
+# .PHONY: switch
+# switch:
+# ./bin/system switch
+#
+# .PHONY: boot
+# boot:
+# ./bin/system boot
.PHONY: install-hooks
install-hooks: