{ config, lib, ... }: let allowedUnf = config.nixpkgs.allowedUnfree; allowedIns = config.nixpkgs.allowedInsecure; in { options.nixpkgs.allowedUnfree = lib.mkOption { type = lib.types.listOf lib.types.str; default = [ ]; description = '' Allows for unfree packages by their name. ''; }; options.nixpkgs.allowedInsecure = lib.mkOption { type = lib.types.listOf lib.types.str; default = [ ]; description = '' Allows for insercure packages by their name. ''; }; config.nixpkgs.config.allowUnfreePredicate = if (allowedUnf == [ ]) then (_: false) else (pkg: __elem (lib.getName pkg) allowedUnf); config.nixpkgs.config.allowInsecurePredicate = if (allowedIns == [ ]) then (_: false) else (pkg: __elem (lib.getName pkg) allowedIns); }