All checks were successful
CI / Format Check (push) Successful in 2s
CI / Flake Check (push) Successful in 1m34s
CI / Evaluate Key Configurations (nix-builder) (push) Successful in 11s
CI / Evaluate Key Configurations (nix-desktop1) (push) Successful in 12s
CI / Evaluate Key Configurations (nix-laptop1) (push) Successful in 8s
CI / Evaluate Artifacts (installer-iso-nix-laptop1) (push) Successful in 17s
CI / Evaluate Artifacts (lxc-nix-builder) (push) Successful in 11s
76 lines
2.4 KiB
Nix
76 lines
2.4 KiB
Nix
# ============================================================================
|
|
# Fleet Option Definition
|
|
# ============================================================================
|
|
# This module only defines the athenix.fleet option without any dependencies.
|
|
# Used by fleet/default.nix to evaluate inventory data without circular dependencies.
|
|
{ inputs, ... }:
|
|
{ lib, ... }:
|
|
let
|
|
fleetDefinition = lib.mkOption {
|
|
description = "Hardware types definitions for the fleet.";
|
|
type = lib.types.attrsOf (
|
|
lib.types.submodule (
|
|
{ name, ... }:
|
|
{
|
|
options = {
|
|
type = lib.mkOption {
|
|
type = lib.types.oneOf [
|
|
lib.types.str
|
|
lib.types.listOf
|
|
lib.types.str
|
|
];
|
|
default = name;
|
|
description = "Type(s) of system configuration for this device.";
|
|
};
|
|
system = lib.mkOption {
|
|
type = lib.types.str;
|
|
default = "x86_64-linux";
|
|
description = "NixOS system architecture for this hardware type.";
|
|
};
|
|
devices = lib.mkOption {
|
|
type = lib.types.oneOf [
|
|
lib.types.int
|
|
(lib.types.attrsOf (
|
|
lib.types.submodule (
|
|
{ name, ... }:
|
|
{
|
|
freeformType = lib.types.attrs;
|
|
}
|
|
)
|
|
))
|
|
];
|
|
};
|
|
count = lib.mkOption {
|
|
type = lib.types.int;
|
|
default = 0;
|
|
description = "Number of devices of this type to create.";
|
|
};
|
|
defaultCount = lib.mkOption {
|
|
type = lib.types.int;
|
|
default = 0;
|
|
description = "Default number of devices to create with default configurations and numbered hostnames.";
|
|
};
|
|
overrides = lib.mkOption {
|
|
type = lib.types.attrs;
|
|
default = { };
|
|
description = "Overrides to apply to all devices of this type.";
|
|
};
|
|
};
|
|
}
|
|
)
|
|
);
|
|
};
|
|
in
|
|
{
|
|
options.athenix = {
|
|
fleet = fleetDefinition;
|
|
hwTypes = lib.mkOption {
|
|
description = "Hardware types definitions for the fleet.";
|
|
type = lib.types.attrs;
|
|
};
|
|
};
|
|
|
|
config.athenix.fleet = lib.mkDefault (import ../inventory.nix);
|
|
config.athenix.hwTypes = lib.mkDefault (import ../hw { inherit inputs; });
|
|
}
|