1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
{ lib, config, ... }: let cfg = config.this.unfree; inherit (builtins) elem; inherit (lib) getName; in { options = { this.unfree.allowed = lib.mkOption { type = with lib.types; listOf str; default = []; }; }; config = { nixpkgs.config.allowUnfreePredicate = pkg: elem (getName pkg) cfg.allowed; }; }