fix: allow modules modules that are not functions

This commit is contained in:
PerchunPak 2024-04-16 11:19:30 +02:00 committed by Jake Hamilton
parent 63a1abf65b
commit 1ee256fa62
No known key found for this signature in database
GPG key ID: 9762169A1B35EA68
3 changed files with 27 additions and 7 deletions

View file

@ -4,7 +4,7 @@
snowfall-lib,
snowfall-config,
}: let
inherit (core-inputs.nixpkgs.lib) assertMsg fix fold filterAttrs callPackageWith;
inherit (core-inputs.nixpkgs.lib) fix filterAttrs callPackageWith isFunction;
core-inputs-libs = snowfall-lib.flake.get-libs (snowfall-lib.flake.without-self core-inputs);
user-inputs-libs = snowfall-lib.flake.get-libs (snowfall-lib.flake.without-self user-inputs);
@ -34,7 +34,15 @@
};
libs =
builtins.map
(path: callPackageWith attrs path {})
(
path: let
imported-module = import path;
in
if isFunction imported-module
then callPackageWith attrs path {}
# the only difference is that there is no `override` and `overrideDerivation` on returned value
else imported-module
)
user-lib-modules;
in
snowfall-lib.attrs.merge-deep libs