mirror of
https://github.com/moons-14/dotfiles.git
synced 2026-10-06 07:28:12 +09:00
style: format registry validation
This commit is contained in:
+14
-24
@@ -47,40 +47,30 @@ let
|
|||||||
}
|
}
|
||||||
) hostSpecs;
|
) hostSpecs;
|
||||||
|
|
||||||
units = lib.mapAttrs (
|
units = lib.mapAttrs (_id: unit: {
|
||||||
_id: unit: {
|
inherit (unit) id relativePath;
|
||||||
inherit (unit) id relativePath;
|
directory = "modules/${lib.concatStringsSep "/" unit.relativePath}";
|
||||||
directory = "modules/${lib.concatStringsSep "/" unit.relativePath}";
|
includes = unit.meta.includes;
|
||||||
includes = unit.meta.includes;
|
fragments = builtins.attrNames (lib.filterAttrs (_: value: value != null) unit.fragments);
|
||||||
fragments = builtins.attrNames (lib.filterAttrs (_: value: value != null) unit.fragments);
|
}) dotfilesLib.registry.units;
|
||||||
}
|
|
||||||
) dotfilesLib.registry.units;
|
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
flake = {
|
flake = {
|
||||||
inherit (configurations) darwinConfigurations nixosConfigurations;
|
inherit (configurations) darwinConfigurations nixosConfigurations;
|
||||||
lib = dotfilesLib // { inherit validationMetadata; };
|
lib = dotfilesLib // {
|
||||||
|
inherit validationMetadata;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
perSystem =
|
perSystem =
|
||||||
{ pkgs, system, ... }:
|
{ pkgs, system, ... }:
|
||||||
let
|
let
|
||||||
nixosChecks = lib.mapAttrs' (
|
nixosChecks =
|
||||||
name: nixos:
|
lib.mapAttrs' (name: nixos: lib.nameValuePair "nixos-${name}" nixos.config.system.build.toplevel)
|
||||||
lib.nameValuePair "nixos-${name}" nixos.config.system.build.toplevel
|
(lib.filterAttrs (name: _: hostSpecs.${name}.system == system) configurations.nixosConfigurations);
|
||||||
) (
|
darwinChecks = lib.mapAttrs' (name: darwin: lib.nameValuePair "darwin-${name}" darwin.system) (
|
||||||
lib.filterAttrs (
|
lib.filterAttrs (name: _: hostSpecs.${name}.system == system) configurations.darwinConfigurations
|
||||||
name: _: hostSpecs.${name}.system == system
|
|
||||||
) configurations.nixosConfigurations
|
|
||||||
);
|
|
||||||
darwinChecks = lib.mapAttrs' (
|
|
||||||
name: darwin:
|
|
||||||
lib.nameValuePair "darwin-${name}" darwin.system
|
|
||||||
) (
|
|
||||||
lib.filterAttrs (
|
|
||||||
name: _: hostSpecs.${name}.system == system
|
|
||||||
) configurations.darwinConfigurations
|
|
||||||
);
|
);
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user