mirror of
https://codeberg.org/privacy1st/nix-git
synced 2024-11-22 22:09:34 +01:00
23 lines
682 B
Nix
23 lines
682 B
Nix
{ 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;
|
|
}
|