nixos-configs/common/pkgs/default.nix
matt1432 9f2b537bf7
All checks were successful
Discord / discord commits (push) Has been skipped
refactor: use non-flake inputs instead of fetchers
2023-12-31 15:44:53 -05:00

25 lines
440 B
Nix

{
lib,
pkgs,
...
} @ inputs:
with lib; let
mkPackage = name: v: {
${name} = pkgs.callPackage ./${name} inputs;
};
rmNotPackage = name: value:
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;
}