blob: b6d187e1f30615ff309294ea1c99dac0027bc59b [file] [log] [blame]
Skyler Grey252927a2022-10-18 22:18:15 +01001{ lib
2, config
3, ...
4}:
5let
Skyler Grey73131c32022-08-26 06:53:32 +01006 allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) config.internal.allowUnfree;
Skyler Grey252927a2022-10-18 22:18:15 +01007in
8{
Skyler Grey73131c32022-08-26 06:53:32 +01009 options.internal.allowUnfree = with lib;
10 mkOption {
11 type = types.listOf types.str;
Skyler Grey252927a2022-10-18 22:18:15 +010012 default = [ ];
Skyler Grey73131c32022-08-26 06:53:32 +010013 description = "Unfree packages to permit installing via the AllowUnfreePredicate";
14 };
15 config = {
16 environment.variables = {
17 NIXPKGS_ALLOW_UNFREE = "1";
18 };
19 nixpkgs.config.allowUnfreePredicate = allowUnfreePredicate;
20 };
21}