flake.nix: Add app to locally build remote deployment

neomutt
Simon Bruder 2021-12-26 12:54:05 +01:00
parent c55bc54b35
commit e1cda094c0
Signed by: simon
GPG Key ID: 8D3C82F9F309F8EC
1 changed files with 12 additions and 0 deletions

View File

@ -109,6 +109,18 @@
)
self.nixosConfigurations);
deploy-local = lib.recurseIntoAttrs (lib.mapAttrs
(hostname: machine: pkgs.writeShellScript "deploy-local-${hostname}" ''
${pkgs.nixos-rebuild.override { nix = pkgs.nixFlakes; }}/bin/nixos-rebuild \
switch \
--flake .#${hostname} \
-L \
--build-host localhost \
--target-host root@${machine.config.deployment.targetHost} \
--use-substitutes
'')
self.nixosConfigurations);
unlock = lib.recurseIntoAttrs (lib.mapAttrs
(hostname: machine:
let