refactor(dotfiles): apply natu ordering
This commit is contained in:
@@ -5,19 +5,6 @@
|
|||||||
root,
|
root,
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
registry = import ./registry.nix {
|
|
||||||
inherit lib;
|
|
||||||
hosts = self.nixosConfigurations;
|
|
||||||
root = root + "/registry";
|
|
||||||
};
|
|
||||||
|
|
||||||
modules = import ./modules.nix {
|
|
||||||
inherit util;
|
|
||||||
root = root + "/modules";
|
|
||||||
};
|
|
||||||
|
|
||||||
util = import ./util.nix { inherit lib; };
|
|
||||||
|
|
||||||
specialArgs = {
|
specialArgs = {
|
||||||
inherit
|
inherit
|
||||||
inputs
|
inputs
|
||||||
@@ -27,6 +14,14 @@ let
|
|||||||
registry = registry.collected;
|
registry = registry.collected;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
util = import ./util.nix { inherit lib; };
|
||||||
|
|
||||||
|
registry = import ./registry.nix {
|
||||||
|
inherit lib;
|
||||||
|
hosts = self.nixosConfigurations;
|
||||||
|
root = root + "/registry";
|
||||||
|
};
|
||||||
|
|
||||||
guestModules = import ./guests.nix {
|
guestModules = import ./guests.nix {
|
||||||
inherit
|
inherit
|
||||||
inputs
|
inputs
|
||||||
@@ -38,6 +33,11 @@ let
|
|||||||
repositoryModules = modules;
|
repositoryModules = modules;
|
||||||
root = root + "/guests";
|
root = root + "/guests";
|
||||||
};
|
};
|
||||||
|
modules = import ./modules.nix {
|
||||||
|
inherit util;
|
||||||
|
root = root + "/modules";
|
||||||
|
};
|
||||||
|
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
nixosConfigurations = import ./hosts.nix {
|
nixosConfigurations = import ./hosts.nix {
|
||||||
|
|||||||
@@ -34,6 +34,17 @@ let
|
|||||||
inherit (evaluated.config) type replicate checks;
|
inherit (evaluated.config) type replicate checks;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
registryLib = lib // {
|
||||||
|
registry = (lib.registry or { }) // {
|
||||||
|
inherit predicates;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
predicates = {
|
||||||
|
uniqueValue =
|
||||||
|
value: entries: builtins.length (lib.unique (map value entries)) == builtins.length entries;
|
||||||
|
};
|
||||||
|
|
||||||
registryDefinitionModule = {
|
registryDefinitionModule = {
|
||||||
options = {
|
options = {
|
||||||
type = lib.mkOption {
|
type = lib.mkOption {
|
||||||
@@ -79,6 +90,15 @@ let
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
registryOption =
|
||||||
|
registry:
|
||||||
|
lib.mkOption {
|
||||||
|
type = lib.types.attrsOf (lib.types.attrsOf registry.type);
|
||||||
|
default = { };
|
||||||
|
description = ''
|
||||||
|
Lazily collected fleet-visible registry entries, nested by host and entry name.
|
||||||
|
'';
|
||||||
|
};
|
||||||
withOperations =
|
withOperations =
|
||||||
registry:
|
registry:
|
||||||
registry
|
registry
|
||||||
@@ -188,27 +208,6 @@ let
|
|||||||
) data
|
) data
|
||||||
);
|
);
|
||||||
|
|
||||||
predicates = {
|
|
||||||
uniqueValue =
|
|
||||||
value: entries: builtins.length (lib.unique (map value entries)) == builtins.length entries;
|
|
||||||
};
|
|
||||||
|
|
||||||
registryLib = lib // {
|
|
||||||
registry = (lib.registry or { }) // {
|
|
||||||
inherit predicates;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
registryOption =
|
|
||||||
registry:
|
|
||||||
lib.mkOption {
|
|
||||||
type = lib.types.attrsOf (lib.types.attrsOf registry.type);
|
|
||||||
default = { };
|
|
||||||
description = ''
|
|
||||||
Lazily collected fleet-visible registry entries, nested by host and entry name.
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
types = lib.mapAttrs (_name: definition: definition.type) definitions;
|
types = lib.mapAttrs (_name: definition: definition.type) definitions;
|
||||||
|
|||||||
Reference in New Issue
Block a user