Refactored the repository structure by renaming variants/ to hw and glue/ to fleet, fixing an infinite recursion bug by separating fleet options evaluation, and adding a lib.mkFleet function to enable external flakes to reuse Athenix's fleet generation #29

Merged
hdh20267 merged 10 commits from inventory-as-module into main 2026-01-07 23:20:24 +00:00
3 changed files with 20 additions and 2 deletions
Showing only changes of commit 1ce7334a73 - Show all commits

View File

@@ -69,7 +69,7 @@
...
}:
let
fleet = import ./glue/fleet.nix { inherit inputs; };
fleet = self.lib.mkFleet { inherit inputs; };
linuxSystem = "x86_64-linux";
artifacts = import ./installer/artifacts.nix {
inherit inputs fleet self;
@@ -90,11 +90,14 @@
nixosConfigurations = fleet.nixosConfigurations;
# 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
nixosModules = import ./installer/modules.nix { inherit inputs; };
# Library functions
lib = import ./lib { inherit inputs; };
# Templates for external configurations
templates = import ./templates;
};

4
lib/default.nix Normal file
View File

@@ -0,0 +1,4 @@
{ inputs }:
{
mkFleet = import ./mkFleet.nix;
}

11
lib/mkFleet.nix Normal file
View 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;
}