flake.nix: Add app to locally build remote deployment

This commit is contained in:
Simon Bruder 2021-12-26 12:54:05 +01:00
parent c55bc54b35
commit e1cda094c0
Signed by: simon
GPG key ID: 8D3C82F9F309F8EC

View file

@ -109,6 +109,18 @@
) )
self.nixosConfigurations); 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 unlock = lib.recurseIntoAttrs (lib.mapAttrs
(hostname: machine: (hostname: machine:
let let