summaryrefslogtreecommitdiff
path: root/modules/unfree.nix
blob: e91bf6c5fecba4b83aeb0fd6cef59d0b74aea9a4 (plain)
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;
  };
}