nixos-servers/nix/flake/deploy.nix

26 lines
645 B
Nix

{ 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:
let
nixosConfiguration = self.nixosConfigurations.${name};
in
{
hostname = nixosConfiguration.config.networking.fqdn;
profiles.system = {
remoteBuild = machine.arch != hostPkgs.stdenv.hostPlatform.system;
path = deploy-rs.lib.${machine.arch}.activate.nixos nixosConfiguration;
};
});
};
}