nixos-servers/deploy.nix
2024-11-04 23:35:04 +01:00

27 lines
657 B
Nix

{
self,
deploy-rs,
...
}: let
deployArch = "x86_64-linux";
mkDeployNodes = nodeDef:
builtins.mapAttrs
(name: module: nodeDef name module)
self.machines;
in {
deploy = {
sshUser = "root";
user = "root";
nodes = mkDeployNodes (name: _module: let
nixosConfiguration = self.nixosConfigurations.${name};
machineArch = nixosConfiguration.config.facter.report.system;
in {
hostname = nixosConfiguration.config.networking.fqdn;
profiles.system = {
remoteBuild = machineArch != deployArch;
path = deploy-rs.lib.${machineArch}.activate.nixos nixosConfiguration;
};
});
};
}