2024-07-19 12:00:55 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
config,
|
|
|
|
pkgs,
|
|
|
|
...
|
|
|
|
}:
|
2024-07-18 11:48:49 +00:00
|
|
|
|
|
|
|
with lib;
|
2024-07-19 12:00:55 +00:00
|
|
|
let
|
2024-07-18 11:48:49 +00:00
|
|
|
cfg = config.modules.unfree;
|
2024-07-19 12:00:55 +00:00
|
|
|
in
|
|
|
|
{
|
2024-07-18 11:48:49 +00:00
|
|
|
options.modules.unfree = {
|
|
|
|
enable = mkEnableOption "unfree";
|
|
|
|
allowedPackages = mkOption {
|
|
|
|
type = types.listOf types.str;
|
2024-07-19 12:00:55 +00:00
|
|
|
default = [ ];
|
2024-07-18 11:48:49 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
config = mkIf cfg.enable {
|
|
|
|
nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (getName pkg) cfg.allowedPackages;
|
|
|
|
};
|
2024-07-19 12:00:55 +00:00
|
|
|
}
|