{ config, lib, ... }: # See also: ./nur-and-unstable.nix to allow unfree packages from "unstable". # See also: ./base.nix for unfree firmware. # This file adds the ability to whitelist unfree packages in different .nix config files. # Example: Instead of # nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [ # "obsidian" # ]; # add the following # allowUnfree = [ "obsidian" ]; let inherit (builtins) elem; inherit (lib) getName mkOption; inherit (lib.types) listOf str; in { options.allowUnfree = mkOption { type = listOf str; default = [ ]; }; config.nixpkgs.config.allowUnfreePredicate = p: elem (getName p) config.allowUnfree; }