nixos-configs/common/pkgs/default.nix

28 lines
501 B
Nix
Raw Normal View History

2023-12-02 14:32:48 -05:00
{
lib,
pkgs,
...
} @ inputs:
2024-01-22 11:09:37 -05:00
let
inherit (lib) concatMapAttrs filterAttrs mkOption pathExists types;
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;
}