From 08c22d8d40f19cae1d88145ab4fb3ab79b666cb8 Mon Sep 17 00:00:00 2001 From: Dmitriy Pleshevskiy Date: Wed, 30 Nov 2022 23:38:47 +0300 Subject: [PATCH] add makefile --- Makefile | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..a8065a5 --- /dev/null +++ b/Makefile @@ -0,0 +1,50 @@ +NIX_RUN := sudo nix run .\# +NIX_LOCK := nix flake lock + +DEPS_MY := \ + myneovim \ + mytools \ + vnetod + +DEPS_NIXOS := \ + nixpkgs \ + hardware \ + home-manager \ + agenix + +DEPS_MISC := \ + wired \ + nil \ + mailserver + +MACHINES := \ + home \ + asus-gl553vd + +VPS := \ + magenta + +help: + cat Makefile + +define machine_rule +$(1): ; $$(NIX_RUN)switch/$(1) +$(1)-test: ; $$(NIX_RUN)test/$(1) +endef + +define vps_rule +$(1): ; $$(NIX)deploy/$(1) +endef + +$(foreach machine,$(MACHINES),$(eval $(call machine_rule,$(machine)))) +$(foreach vps,$(VPS),$(eval $(call vps_rule,$(vps)))) + +deps-bump-my: + $(NIX_LOCK) $(foreach dep,$(DEPS_MY),--update-input $(dep)) + +deps-bump-nixos: + $(NIX_LOCK) $(foreach dep,$(DEPS_NIXOS),--update-input $(dep)) + +deps-bump-misc: + $(NIX_LOCK) $(foreach dep,$(DEPS_MISC),--update-input $(dep)) +