nixos-configs/common/pkgs/default.nix

26 lines
440 B
Nix
Raw Normal View History

2023-12-02 14:32:48 -05:00
{
lib,
pkgs,
...
} @ inputs:
with lib; let
mkPackage = name: v: {
${name} = pkgs.callPackage ./${name} inputs;
};
rmNotPackage = name: value:
2023-12-02 14:32:48 -05:00
value
== "directory"
&& pathExists ./${name}/default.nix;
packages = filterAttrs rmNotPackage (builtins.readDir ./.);
pkgSet = concatMapAttrs mkPackage packages;
in {
options.customPkgs = mkOption {
type = types.attrs;
};
config.customPkgs = pkgSet;
}