From 56992b8c945d497a623fe693847c91235be1ae02 Mon Sep 17 00:00:00 2001 From: sefidel Date: Tue, 28 Dec 2021 01:11:25 +0900 Subject: initial commit --- home/modules/programs/nixpkgs/default.nix | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 home/modules/programs/nixpkgs/default.nix (limited to 'home/modules/programs/nixpkgs') diff --git a/home/modules/programs/nixpkgs/default.nix b/home/modules/programs/nixpkgs/default.nix new file mode 100644 index 0000000..92653a1 --- /dev/null +++ b/home/modules/programs/nixpkgs/default.nix @@ -0,0 +1,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); +} -- cgit 1.4.1