nixos-configs/common/pkgs/default.nix

29 lines
496 B
Nix
Raw Normal View History

2023-12-02 14:32:48 -05:00
{
lib,
pkgs,
...
}: let
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;
packages = lib.attrsets.filterAttrs rmNotPackage (builtins.readDir ./.);
pkgSet = lib.attrsets.concatMapAttrs mkPackage packages;
in {
2023-12-02 14:32:48 -05:00
imports = [
{
options.customPkgs = lib.mkOption {
type = lib.types.attrs;
};
}
];
customPkgs = pkgSet;
}