Skyler Grey | 73131c3 | 2022-08-26 06:53:32 +0100 | [diff] [blame] | 1 | { |
| 2 | lib, |
| 3 | config, |
| 4 | ... |
| 5 | }: let |
| 6 | allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) config.internal.allowUnfree; |
| 7 | in { |
| 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 | } |