infra/nixos/hosts/default.nix

51 lines
1.1 KiB
Nix

{inputs, ...}: let
systems = {
eidola = import ./eidola {inherit inputs;};
silver = import ./silver {inherit inputs;};
};
inherit (inputs.nixpkgs) lib;
makeNixosConfigurations = systems:
lib.mapAttrs
(name: system:
lib.nixosSystem {
inherit (system) system;
modules =
system.modules
++ [
{
_module.args = {
inherit inputs;
};
}
../modules
];
})
systems;
makeDeployRsNodes = systems:
lib.mapAttrs
(name: system: {
hostname = system.deployment.host;
profiles.system = {
sshUser = system.deployment.user;
sshOpts = ["-p" "${toString system.deployment.port}"];
remoteBuild = system.deployment.buildOnTarget;
magicRollback = true;
path =
inputs.deploy-rs.lib.${system.system}.activate.nixos
inputs.self.nixosConfigurations.${name};
};
})
systems;
in {
nixosConfigurations = makeNixosConfigurations systems;
deploy.nodes = makeDeployRsNodes systems;
}