nix: fix rollback command
This commit is contained in:
parent
8c7fb4159d
commit
6ed972043e
2 changed files with 11 additions and 5 deletions
12
Makefile
12
Makefile
|
@ -37,13 +37,21 @@ $(1): ;
|
|||
systemctl --user reset-failed
|
||||
$$(NIX_RUN)switch/$(1)
|
||||
|
||||
.PHONY: $(1)-test
|
||||
$(1)-test: ; $$(NIX_RUN)test/$(1)
|
||||
.PHONY: rollback-$(1)
|
||||
rollback-$(1):
|
||||
$$(NIX_RUN)rollback/$(1)
|
||||
|
||||
.PHONY: test-$(1)
|
||||
test-$(1): ; $$(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))))
|
||||
|
|
|
@ -74,9 +74,7 @@
|
|||
|
||||
rollback = lib.recurseIntoAttrs (lib.mapAttrs
|
||||
(hostname: machine: pkgs.writeShellScript "rollback-${hostname}" ''
|
||||
${nixos-rebuild}/bin/nixos-rebuild test \
|
||||
--rollback \
|
||||
--flake .#${hostname}
|
||||
${nixos-rebuild}/bin/nixos-rebuild switch --rollback
|
||||
'')
|
||||
self.nixosConfigurations);
|
||||
|
||||
|
|
Loading…
Reference in a new issue