Fix libS input (again)

This commit is contained in:
Sandro - 2023-01-06 21:09:41 +01:00
parent 3698a8baf6
commit b10523c86d
Signed by: sandro
GPG Key ID: 3AF5A43A3EECC2E5
1 changed files with 3 additions and 5 deletions

View File

@ -15,15 +15,13 @@
ls = dir: lib.attrNames (builtins.readDir (./. + "/${dir}"));
in
{
nixosModule = { config, ... }@args: {
_module.args = lib.optionalAttrs (!args ? libS) {
libS = nixos-modules.lib { inherit lib config; };
};
nixosModule = { config, libS, ... }@args: {
_module.args.libS = lib.mkOverride 1001 (nixos-modules.lib { inherit lib config; });
imports = (dir: map
(file: ./. + "/${dir}/${file}")
# assume that the nixos-modules repo is already imported if libS exists
(lib.remove (lib.optionalString (!args ? libs) "default.nix") (ls dir))
(lib.remove (lib.optionalString (lib.hasAttr "libS" args) "default.nix") (ls dir))
) "modules";
};
};