makefile: remove unused commands
This commit is contained in:
parent
cbceaebee2
commit
52f409c4ce
2 changed files with 15 additions and 24 deletions
26
Makefile
26
Makefile
|
@ -28,32 +28,33 @@ VPS := \
|
||||||
help:
|
help:
|
||||||
bat -p Makefile
|
bat -p Makefile
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
# Hosts
|
||||||
|
################################################################################
|
||||||
|
|
||||||
define machine_rule
|
define machine_rule
|
||||||
.PHONY: $(1)
|
.PHONY: $(1)
|
||||||
$(1): ;
|
$(1): ;
|
||||||
systemctl --user reset-failed
|
systemctl --user reset-failed
|
||||||
sudo $$(NIX_RUN)switch/$(1)
|
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
|
endef
|
||||||
|
|
||||||
define vps_rule
|
define vps_rule
|
||||||
.PHONY: $(1)
|
.PHONY: $(1)
|
||||||
$(1): ; $$(NIX_RUN)deploy/$(1)
|
$(1): ; $$(NIX_RUN)deploy/$(1)
|
||||||
|
|
||||||
.PHONY: rollback-$(1)
|
|
||||||
rollback-$(1):
|
|
||||||
$$(NIX_RUN)rollback/$(1)
|
|
||||||
endef
|
endef
|
||||||
|
|
||||||
$(foreach machine,$(MACHINES),$(eval $(call machine_rule,$(machine))))
|
$(foreach machine,$(MACHINES),$(eval $(call machine_rule,$(machine))))
|
||||||
$(foreach vps,$(VPS),$(eval $(call vps_rule,$(vps))))
|
$(foreach vps,$(VPS),$(eval $(call vps_rule,$(vps))))
|
||||||
|
|
||||||
|
.PHONY: rollback
|
||||||
|
rollback:
|
||||||
|
sudo nixos-rebuild --rollback
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
# Deps
|
||||||
|
################################################################################
|
||||||
|
|
||||||
.PHONY: deps-my
|
.PHONY: deps-my
|
||||||
deps-my:
|
deps-my:
|
||||||
$(NIX_LOCK) $(foreach dep,$(DEPS_MY),--update-input $(dep))
|
$(NIX_LOCK) $(foreach dep,$(DEPS_MY),--update-input $(dep))
|
||||||
|
@ -66,3 +67,6 @@ deps-nixos:
|
||||||
deps-misc:
|
deps-misc:
|
||||||
$(NIX_LOCK) $(foreach dep,$(DEPS_MISC),--update-input $(dep))
|
$(NIX_LOCK) $(foreach dep,$(DEPS_MISC),--update-input $(dep))
|
||||||
|
|
||||||
|
.PHONY: deps
|
||||||
|
deps: deps-my deps-nixos deps-misc ;
|
||||||
|
|
||||||
|
|
13
flake.nix
13
flake.nix
|
@ -68,24 +68,11 @@
|
||||||
'')
|
'')
|
||||||
vpsMachines);
|
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
|
switch = lib.recurseIntoAttrs (lib.mapAttrs
|
||||||
(hostname: machine: pkgs.writeShellScript "switch-${hostname}" ''
|
(hostname: machine: pkgs.writeShellScript "switch-${hostname}" ''
|
||||||
${nixos-rebuild}/bin/nixos-rebuild switch --flake .#${hostname} $@
|
${nixos-rebuild}/bin/nixos-rebuild switch --flake .#${hostname} $@
|
||||||
'')
|
'')
|
||||||
localMachines);
|
localMachines);
|
||||||
|
|
||||||
test = lib.recurseIntoAttrs (lib.mapAttrs
|
|
||||||
(hostname: machine: pkgs.writeShellScript "test-${hostname}" ''
|
|
||||||
${nixos-rebuild}/bin/nixos-rebuild test --flake .#${hostname} $@
|
|
||||||
'')
|
|
||||||
localMachines);
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
devShells = {
|
devShells = {
|
||||||
|
|
Loading…
Reference in a new issue