1
0
Fork 0
mirror of https://github.com/hercules-ci/flake-parts.git synced 2025-03-30 19:54:47 +00:00
This commit is contained in:
Yang, Bo 2025-03-07 08:50:34 -08:00 committed by GitHub
commit ff3bc742ab
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 11 additions and 2 deletions

View file

@ -14,10 +14,10 @@ let
then module: module
else
module:
# TODO: set key?
{
_class = class;
_file = "${toString moduleLocation}#modules.${escapeNixIdentifier class}.${escapeNixIdentifier moduleName}";
key = "${toString moduleLocation}#modules.${escapeNixIdentifier class}.${escapeNixIdentifier moduleName}";
imports = [ module ];
};
in

View file

@ -15,7 +15,16 @@ in
nixosModules = mkOption {
type = types.lazyAttrsOf types.deferredModule;
default = { };
apply = mapAttrs (k: v: { _file = "${toString moduleLocation}#nixosModules.${k}"; imports = [ v ]; });
apply = mapAttrs (k: v: {
_file = "${toString moduleLocation}#nixosModules.${k}";
# Note: this neglects to represent potential differences due to input
# overrides or flake-parts extendModules. However, the cost for this
# is too high or plain infeasible respectively. We choose to implement
# deduplication and disabledModules regardless, because not doing
# so poses a more direct problem.
key = "${toString moduleLocation}#nixosModules.${k}";
imports = [ v ];
});
description = ''
NixOS modules.