Skyler Grey | 252927a | 2022-10-18 22:18:15 +0100 | [diff] [blame] | 1 | { lib |
| 2 | , config |
| 3 | , ... |
| 4 | }: |
| 5 | let |
Skyler Grey | 73131c3 | 2022-08-26 06:53:32 +0100 | [diff] [blame] | 6 | allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) config.internal.allowUnfree; |
Skyler Grey | 252927a | 2022-10-18 22:18:15 +0100 | [diff] [blame] | 7 | in |
| 8 | { |
Skyler Grey | 73131c3 | 2022-08-26 06:53:32 +0100 | [diff] [blame] | 9 | options.internal.allowUnfree = with lib; |
| 10 | mkOption { |
| 11 | type = types.listOf types.str; |
Skyler Grey | 252927a | 2022-10-18 22:18:15 +0100 | [diff] [blame] | 12 | default = [ ]; |
Skyler Grey | 73131c3 | 2022-08-26 06:53:32 +0100 | [diff] [blame] | 13 | 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 | } |