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