fix: Remove incorrect ./parts/fleet-data.nix import from flake.nix and use correct flake-parts structure
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
{
|
||||
inputs,
|
||||
fleet ? null,
|
||||
hwTypes ? null,
|
||||
lib,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
|
||||
@@ -13,26 +13,12 @@
|
||||
# configurations with flexible type associations.
|
||||
|
||||
let
|
||||
nixpkgs = inputs.nixpkgs;
|
||||
lib = nixpkgs.lib;
|
||||
|
||||
# Evaluate inventory to get fleet data
|
||||
# Import fleet-option.nix (defines athenix.fleet) and inventory.nix (sets values)
|
||||
# We use a minimal module here to avoid circular dependencies from common.nix's imports
|
||||
inventoryModule = lib.evalModules {
|
||||
modules = [
|
||||
(import ./fleet-option.nix { inherit inputs; })
|
||||
{
|
||||
_module.args = {
|
||||
pkgs = nixpkgs.legacyPackages.x86_64-linux;
|
||||
};
|
||||
}
|
||||
(lib.mkIf (fleet != null) { athenix.fleet = lib.mkForce fleet; })
|
||||
(lib.mkIf (hwTypes != null) { athenix.hwTypes = lib.mkForce hwTypes; })
|
||||
];
|
||||
};
|
||||
|
||||
hostTypes = inventoryModule.config.athenix.hwTypes;
|
||||
|
||||
hostTypes = config.athenix.hwTypes;
|
||||
|
||||
# Helper to create a single NixOS system configuration
|
||||
mkHost =
|
||||
@@ -64,9 +50,7 @@ let
|
||||
null;
|
||||
|
||||
# Load users.nix to find external user modules
|
||||
pkgs = nixpkgs.legacyPackages.${system};
|
||||
usersData = import ../users.nix { inherit pkgs; };
|
||||
accounts = usersData.athenix.users or { };
|
||||
accounts = config.athenix.users or { };
|
||||
|
||||
# Build a map of user names to their nixos module paths (if they exist)
|
||||
# We'll use this to conditionally import modules based on user.enable
|
||||
@@ -285,7 +269,7 @@ let
|
||||
lib.recursiveUpdate deviceHosts countHosts
|
||||
);
|
||||
|
||||
fleetData = inventoryModule.config.athenix.fleet;
|
||||
fleetData = config.athenix.fleet;
|
||||
|
||||
# Flatten the nested structure
|
||||
allHosts = lib.foldl' lib.recursiveUpdate { } (lib.attrValues (processInventory fleetData));
|
||||
|
||||
Reference in New Issue
Block a user