2023-12-02 14:32:48 -05:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
pkgs,
|
|
|
|
...
|
|
|
|
}: let
|
2023-12-01 16:53:51 -05:00
|
|
|
mkPackage = name: v: {
|
|
|
|
${name} = pkgs.callPackage ./${name} {};
|
|
|
|
};
|
|
|
|
|
|
|
|
rmNotPackage = name: value:
|
2023-12-02 14:32:48 -05:00
|
|
|
value
|
|
|
|
== "directory"
|
|
|
|
&& builtins.pathExists ./${name}/default.nix;
|
2023-12-01 16:53:51 -05:00
|
|
|
|
|
|
|
packages = lib.attrsets.filterAttrs rmNotPackage (builtins.readDir ./.);
|
|
|
|
|
|
|
|
pkgSet = lib.attrsets.concatMapAttrs mkPackage packages;
|
2023-12-01 03:42:56 -05:00
|
|
|
in {
|
2023-12-02 14:32:48 -05:00
|
|
|
imports = [
|
|
|
|
{
|
|
|
|
options.customPkgs = lib.mkOption {
|
|
|
|
type = lib.types.attrs;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
];
|
2023-12-01 16:53:51 -05:00
|
|
|
|
|
|
|
customPkgs = pkgSet;
|
2023-12-01 03:42:56 -05:00
|
|
|
}
|