nixos-servers/deploy.nix
2024-10-28 14:12:06 +01:00

26 lines
607 B
Nix

{
self,
deploy-rs,
...
}: let
deployArch = "x86_64-linux";
mkDeployNodes = nodeDef:
builtins.mapAttrs
(name: machine: nodeDef name machine)
self.machines.${deployArch};
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 != deployArch;
path = deploy-rs.lib.${machine.arch}.activate.nixos nixosConfiguration;
};
});
};
}