nixos-servers/deploy.nix

27 lines
633 B
Nix
Raw Normal View History

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