chore: run nix fmt
This commit is contained in:
@@ -22,7 +22,11 @@ let
|
||||
inventoryModule = lib.evalModules {
|
||||
modules = [
|
||||
(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 (hwTypes != null) { athenix.hwTypes = lib.mkForce hwTypes; })
|
||||
];
|
||||
|
||||
@@ -8,48 +8,57 @@
|
||||
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.";
|
||||
};
|
||||
};
|
||||
}));
|
||||
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
|
||||
{
|
||||
|
||||
@@ -14,15 +14,10 @@ let
|
||||
|
||||
# Keep only regular *.nix files except default.nix
|
||||
nixFiles = filterAttrs (
|
||||
name: type:
|
||||
type == "regular"
|
||||
&& lib.hasSuffix ".nix" name
|
||||
&& name != "default.nix"
|
||||
name: type: type == "regular" && lib.hasSuffix ".nix" name && name != "default.nix"
|
||||
) files;
|
||||
|
||||
moduleNames = map (name: removeSuffix ".nix" name) (attrNames nixFiles);
|
||||
in
|
||||
# Export: { name = <module function from ./name.nix>; }
|
||||
genAttrs moduleNames (name:
|
||||
import (./. + ("/" + name + ".nix"))
|
||||
)
|
||||
genAttrs moduleNames (name: import (./. + ("/" + name + ".nix")))
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
fleet ? null,
|
||||
hwTypes ? null,
|
||||
}:
|
||||
import ../fleet/default.nix {
|
||||
inherit inputs;
|
||||
inherit fleet hwTypes;
|
||||
}
|
||||
import ../fleet/default.nix {
|
||||
inherit inputs;
|
||||
inherit fleet hwTypes;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user