about summary refs log tree commit diff
path: root/home/modules/programs/nixpkgs/default.nix
blob: 92653a1354c4f484a75af2d558f750f5ab9870a2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
{ config, lib, ... }:

let
  allowed = config.nixpkgs.allowedUnfree;
in

{
  options.nixpkgs.allowedUnfree = lib.mkOption {
    type = lib.types.listOf lib.types.string;
    default = [ ];
    description = ''
      Allows for  unfree packages by their name.
    '';
  };

  config.nixpkgs.config.allowUnfreePredicate =
    if (allowed == [ ])
    then (_: false)
    else (pkg: __elem (lib.getName pkg) allowed);
}