chore: run nix fmt
This commit is contained in:
@@ -22,7 +22,11 @@ let
|
|||||||
inventoryModule = lib.evalModules {
|
inventoryModule = lib.evalModules {
|
||||||
modules = [
|
modules = [
|
||||||
(import ./fleet-option.nix { inherit inputs; })
|
(import ./fleet-option.nix { inherit inputs; })
|
||||||
{ _module.args = { pkgs = nixpkgs.legacyPackages.x86_64-linux; }; }
|
{
|
||||||
|
_module.args = {
|
||||||
|
pkgs = nixpkgs.legacyPackages.x86_64-linux;
|
||||||
|
};
|
||||||
|
}
|
||||||
(lib.mkIf (fleet != null) { athenix.fleet = lib.mkForce fleet; })
|
(lib.mkIf (fleet != null) { athenix.fleet = lib.mkForce fleet; })
|
||||||
(lib.mkIf (hwTypes != null) { athenix.hwTypes = lib.mkForce hwTypes; })
|
(lib.mkIf (hwTypes != null) { athenix.hwTypes = lib.mkForce hwTypes; })
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -8,48 +8,57 @@
|
|||||||
let
|
let
|
||||||
fleetDefinition = lib.mkOption {
|
fleetDefinition = lib.mkOption {
|
||||||
description = "Hardware types definitions for the fleet.";
|
description = "Hardware types definitions for the fleet.";
|
||||||
type = lib.types.attrsOf (lib.types.submodule ({ name, ...}: {
|
type = lib.types.attrsOf (
|
||||||
options = {
|
lib.types.submodule (
|
||||||
type = lib.mkOption {
|
{ name, ... }:
|
||||||
type = lib.types.oneOf [
|
{
|
||||||
lib.types.str
|
options = {
|
||||||
lib.types.listOf lib.types.str
|
type = lib.mkOption {
|
||||||
];
|
type = lib.types.oneOf [
|
||||||
default = name;
|
lib.types.str
|
||||||
description = "Type(s) of system configuration for this device.";
|
lib.types.listOf
|
||||||
};
|
lib.types.str
|
||||||
system = lib.mkOption {
|
];
|
||||||
type = lib.types.str;
|
default = name;
|
||||||
default = "x86_64-linux";
|
description = "Type(s) of system configuration for this device.";
|
||||||
description = "NixOS system architecture for this hardware type.";
|
};
|
||||||
};
|
system = lib.mkOption {
|
||||||
devices = lib.mkOption {
|
type = lib.types.str;
|
||||||
type = lib.types.oneOf [
|
default = "x86_64-linux";
|
||||||
lib.types.int
|
description = "NixOS system architecture for this hardware type.";
|
||||||
(lib.types.attrsOf
|
};
|
||||||
(lib.types.submodule ({ name, ... }: {
|
devices = lib.mkOption {
|
||||||
freeformType = lib.types.attrs;
|
type = lib.types.oneOf [
|
||||||
})
|
lib.types.int
|
||||||
))
|
(lib.types.attrsOf (
|
||||||
];
|
lib.types.submodule (
|
||||||
};
|
{ name, ... }:
|
||||||
count = lib.mkOption {
|
{
|
||||||
type = lib.types.int;
|
freeformType = lib.types.attrs;
|
||||||
default = 0;
|
}
|
||||||
description = "Number of devices of this type to create.";
|
)
|
||||||
};
|
))
|
||||||
defaultCount = lib.mkOption {
|
];
|
||||||
type = lib.types.int;
|
};
|
||||||
default = 0;
|
count = lib.mkOption {
|
||||||
description = "Default number of devices to create with default configurations and numbered hostnames.";
|
type = lib.types.int;
|
||||||
};
|
default = 0;
|
||||||
overrides = lib.mkOption {
|
description = "Number of devices of this type to create.";
|
||||||
type = lib.types.attrs;
|
};
|
||||||
default = { };
|
defaultCount = lib.mkOption {
|
||||||
description = "Overrides to apply to all devices of this type.";
|
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
|
in
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -14,15 +14,10 @@ let
|
|||||||
|
|
||||||
# Keep only regular *.nix files except default.nix
|
# Keep only regular *.nix files except default.nix
|
||||||
nixFiles = filterAttrs (
|
nixFiles = filterAttrs (
|
||||||
name: type:
|
name: type: type == "regular" && lib.hasSuffix ".nix" name && name != "default.nix"
|
||||||
type == "regular"
|
|
||||||
&& lib.hasSuffix ".nix" name
|
|
||||||
&& name != "default.nix"
|
|
||||||
) files;
|
) files;
|
||||||
|
|
||||||
moduleNames = map (name: removeSuffix ".nix" name) (attrNames nixFiles);
|
moduleNames = map (name: removeSuffix ".nix" name) (attrNames nixFiles);
|
||||||
in
|
in
|
||||||
# Export: { name = <module function from ./name.nix>; }
|
# Export: { name = <module function from ./name.nix>; }
|
||||||
genAttrs moduleNames (name:
|
genAttrs moduleNames (name: import (./. + ("/" + name + ".nix")))
|
||||||
import (./. + ("/" + name + ".nix"))
|
|
||||||
)
|
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
fleet ? null,
|
fleet ? null,
|
||||||
hwTypes ? null,
|
hwTypes ? null,
|
||||||
}:
|
}:
|
||||||
import ../fleet/default.nix {
|
import ../fleet/default.nix {
|
||||||
inherit inputs;
|
inherit inputs;
|
||||||
inherit fleet hwTypes;
|
inherit fleet hwTypes;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user