Files
nix/deploy/colmena.nix

40 lines
908 B
Nix

{
self,
inputs,
}:
let
inherit (inputs.nixpkgs) lib;
utils = import ../utils { inherit lib; };
hostDirNames = utils.dirNames ../hosts;
mkNode = hostname: tags: {
imports = [ ../hosts/${hostname} ];
deployment = {
targetHost = self.nixosConfigurations.${hostname}.config.ssh.publicHostname;
targetUser = self.nixosConfigurations.${hostname}.config.ssh.username;
buildOnTarget = builtins.any (t: t != "local" && t != "arm") tags;
inherit tags;
};
};
nodes = lib.genAttrs hostDirNames (
hostname: mkNode hostname (utils.hostMeta ../hosts/${hostname}).deployment.tags
);
in
inputs.colmena.lib.makeHive (
{
meta = {
nixpkgs = import inputs.nixpkgs { localSystem = "x86_64-linux"; };
specialArgs = {
inherit inputs;
outputs = self;
dotsPath = ../dots;
myUtils = utils;
};
};
}
// nodes
)