makefile: remove unused commands

This commit is contained in:
Dmitriy Pleshevskiy 2024-03-29 18:27:33 +03:00
parent cbceaebee2
commit 52f409c4ce
Signed by: pleshevskiy
GPG key ID: 17041163DA10A9A2
2 changed files with 15 additions and 24 deletions

View file

@ -28,32 +28,33 @@ VPS := \
help:
bat -p Makefile
################################################################################
# Hosts
################################################################################
define machine_rule
.PHONY: $(1)
$(1): ;
systemctl --user reset-failed
sudo $$(NIX_RUN)switch/$(1)
.PHONY: rollback-$(1)
rollback-$(1):
sudo $$(NIX_RUN)rollback/$(1)
.PHONY: test-$(1)
test-$(1): ; sudo $$(NIX_RUN)test/$(1)
endef
define vps_rule
.PHONY: $(1)
$(1): ; $$(NIX_RUN)deploy/$(1)
.PHONY: rollback-$(1)
rollback-$(1):
$$(NIX_RUN)rollback/$(1)
endef
$(foreach machine,$(MACHINES),$(eval $(call machine_rule,$(machine))))
$(foreach vps,$(VPS),$(eval $(call vps_rule,$(vps))))
.PHONY: rollback
rollback:
sudo nixos-rebuild --rollback
################################################################################
# Deps
################################################################################
.PHONY: deps-my
deps-my:
$(NIX_LOCK) $(foreach dep,$(DEPS_MY),--update-input $(dep))
@ -66,3 +67,6 @@ deps-nixos:
deps-misc:
$(NIX_LOCK) $(foreach dep,$(DEPS_MISC),--update-input $(dep))
.PHONY: deps
deps: deps-my deps-nixos deps-misc ;

View file

@ -68,24 +68,11 @@
'')
vpsMachines);
rollback = lib.recurseIntoAttrs (lib.mapAttrs
(hostname: machine: pkgs.writeShellScript "rollback-${hostname}" ''
${nixos-rebuild}/bin/nixos-rebuild switch --rollback
'')
self.nixosConfigurations);
switch = lib.recurseIntoAttrs (lib.mapAttrs
(hostname: machine: pkgs.writeShellScript "switch-${hostname}" ''
${nixos-rebuild}/bin/nixos-rebuild switch --flake .#${hostname} $@
'')
localMachines);
test = lib.recurseIntoAttrs (lib.mapAttrs
(hostname: machine: pkgs.writeShellScript "test-${hostname}" ''
${nixos-rebuild}/bin/nixos-rebuild test --flake .#${hostname} $@
'')
localMachines);
});
devShells = {