nixos-servers/nix/flake/deploy.nix

24 lines
583 B
Nix
Raw Normal View History

2024-03-02 12:58:17 +00:00
{ self, hostPkgs, physicalMachines, deploy-rs, ... }:
let
mkDeployNodes = nodeDef:
builtins.mapAttrs
(name: machine: nodeDef name machine)
physicalMachines;
in
{
deploy = {
sshUser = "root";
user = "root";
nodes = mkDeployNodes (name: machine: {
hostname = self.nixosConfigurations.${name}.config.networking.fqdn;
profiles.system = {
remoteBuild = machine.arch != hostPkgs.stdenv.hostPlatform.system;
path = deploy-rs.lib.${machine.arch}.activate.nixos
self.nixosConfigurations.${name};
};
});
};
}