feat: add lib.mkFleet for external flake consumption
- Create lib/mkFleet.nix to expose fleet generator as library function
- Allow external flakes to use Athenix's fleet logic with custom inventory
- Export lib output in flake.nix with proper input passing
- Enable usage: nixosConfigurations = athenix.lib.mkFleet { fleet = ...; hwTypes = ...; }
This commit is contained in:
@@ -69,7 +69,7 @@
|
|||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
fleet = import ./glue/fleet.nix { inherit inputs; };
|
fleet = self.lib.mkFleet { inherit inputs; };
|
||||||
linuxSystem = "x86_64-linux";
|
linuxSystem = "x86_64-linux";
|
||||||
artifacts = import ./installer/artifacts.nix {
|
artifacts = import ./installer/artifacts.nix {
|
||||||
inherit inputs fleet self;
|
inherit inputs fleet self;
|
||||||
@@ -90,11 +90,14 @@
|
|||||||
nixosConfigurations = fleet.nixosConfigurations;
|
nixosConfigurations = fleet.nixosConfigurations;
|
||||||
|
|
||||||
# Expose artifacts to all systems, but they are always built for x86_64-linux
|
# Expose artifacts to all systems, but they are always built for x86_64-linux
|
||||||
packages = forAllSystems (_: artifacts);
|
packages.${linuxSystem} = artifacts;
|
||||||
|
|
||||||
# Expose host type modules and installer modules for external use
|
# Expose host type modules and installer modules for external use
|
||||||
nixosModules = import ./installer/modules.nix { inherit inputs; };
|
nixosModules = import ./installer/modules.nix { inherit inputs; };
|
||||||
|
|
||||||
|
# Library functions
|
||||||
|
lib = import ./lib { inherit inputs; };
|
||||||
|
|
||||||
# Templates for external configurations
|
# Templates for external configurations
|
||||||
templates = import ./templates;
|
templates = import ./templates;
|
||||||
};
|
};
|
||||||
|
|||||||
4
lib/default.nix
Normal file
4
lib/default.nix
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
{ inputs }:
|
||||||
|
{
|
||||||
|
mkFleet = import ./mkFleet.nix;
|
||||||
|
}
|
||||||
11
lib/mkFleet.nix
Normal file
11
lib/mkFleet.nix
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
# Generate fleet configurations with custom fleet and hardware types
|
||||||
|
# Usage: nixosConfigurations = athenix.lib.mkFleet { fleet = { ... }; hwTypes = { ... }; }
|
||||||
|
{
|
||||||
|
inputs,
|
||||||
|
fleet ? null,
|
||||||
|
hwTypes ? null,
|
||||||
|
}:
|
||||||
|
import ../fleet/default.nix {
|
||||||
|
inherit inputs;
|
||||||
|
inherit fleet hwTypes;
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user