2023-12-02 14:32:48 -05:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
pkgs,
|
|
|
|
...
|
2024-01-27 03:02:01 -05:00
|
|
|
} @ inputs: let
|
2024-01-22 11:09:37 -05:00
|
|
|
inherit (lib) concatMapAttrs filterAttrs mkOption pathExists types;
|
|
|
|
|
2023-12-01 16:53:51 -05:00
|
|
|
mkPackage = name: v: {
|
2023-12-31 15:44:53 -05:00
|
|
|
${name} = pkgs.callPackage ./${name} inputs;
|
2023-12-01 16:53:51 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
rmNotPackage = name: value:
|
2023-12-02 14:32:48 -05:00
|
|
|
value
|
|
|
|
== "directory"
|
2023-12-27 11:39:38 -05:00
|
|
|
&& pathExists ./${name}/default.nix;
|
2023-12-01 16:53:51 -05:00
|
|
|
|
2023-12-27 11:39:38 -05:00
|
|
|
packages = filterAttrs rmNotPackage (builtins.readDir ./.);
|
2023-12-01 16:53:51 -05:00
|
|
|
|
2023-12-27 11:39:38 -05:00
|
|
|
pkgSet = concatMapAttrs mkPackage packages;
|
2023-12-01 03:42:56 -05:00
|
|
|
in {
|
2023-12-27 11:39:38 -05:00
|
|
|
options.customPkgs = mkOption {
|
|
|
|
type = types.attrs;
|
|
|
|
};
|
2023-12-01 16:53:51 -05:00
|
|
|
|
2023-12-27 11:39:38 -05:00
|
|
|
config.customPkgs = pkgSet;
|
2023-12-01 03:42:56 -05:00
|
|
|
}
|