infra/nixos/hosts/default.nix

50 lines
1.1 KiB
Nix
Raw Normal View History

2024-10-13 15:16:39 -05:00
{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;
};
}
]
++ (import ../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;
}