dentritic refactor

This commit is contained in:
elwrcl committed 2026-07-30 22:58:52 +03:00
1 parent fc386c4053
commit 301ad158d5
140 files changed
+2285 -2622

No files matched your search

+35
View File
@@ -0,0 +1,35 @@
{
config,
lib,
moduleLocation,
...
}:
let
inherit (lib.attrsets) mapAttrs;
inherit (lib.lists) singleton;
inherit (lib.modules) mkMerge;
inherit (lib.options) mkOption;
inherit (lib.types) deferredModule lazyAttrsOf;
wrap =
kind: name: value:
let
file = "${toString moduleLocation}#${kind}.${name}";
in
{
_file = file;
key = file;
imports = singleton value;
};
in
{
options.commonModules = mkOption {
type = lazyAttrsOf deferredModule;
default = { };
apply = mapAttrs (wrap "commonModules");
description = "NixOS and Darwin modules shared between both platforms.";
};
config.flake.nixosModules = mkMerge [ config.commonModules ];
config.flake.darwinModules = mkMerge [ config.commonModules ];
}