2a911b057b
- Introduced a new `navi` module for managing deployments across multiple hosts. - Enhanced SSH inventory management to support public key application for authorized hosts. - Configured system deployment builder for seamless integration with Navi. - Updated various host configurations to enable deployment capabilities and streamline SSH access.
34 lines
886 B
Nix
34 lines
886 B
Nix
# Build a raw Navi hive attrset from host specs + deployment targets.
|
|
# Call `inputs.navi.lib.makeHive` on the result to produce `flake.naviHive`.
|
|
{ lib, inputs, ... }: {
|
|
flake.lib.mkNaviHiveConfig =
|
|
{
|
|
metaNixpkgs,
|
|
hostSpecs,
|
|
deployments,
|
|
}:
|
|
let
|
|
deployNodes = lib.filterAttrs (name: _: deployments ? ${name}) hostSpecs;
|
|
in
|
|
{
|
|
meta = {
|
|
nixpkgs = metaNixpkgs;
|
|
nodeNixpkgs = lib.mapAttrs (
|
|
name: spec:
|
|
import inputs.nixpkgs {
|
|
system = spec.system;
|
|
}
|
|
) deployNodes;
|
|
nodeSpecialArgs = lib.mapAttrs (_: spec: spec.specialArgs) deployNodes;
|
|
allowApplyAll = false;
|
|
};
|
|
}
|
|
// lib.mapAttrs (
|
|
name: spec:
|
|
{
|
|
imports = spec.modules or [ spec.configuration ];
|
|
deployment = deployments.${name};
|
|
}
|
|
) deployNodes;
|
|
}
|