mirror of
https://github.com/Gerg-L/nixos.git
synced 2025-12-10 00:43:56 -05:00
extract unfree option to it's own module
This commit is contained in:
parent
03b359ee5a
commit
3aef3e349f
2 changed files with 74 additions and 73 deletions
|
|
@ -5,18 +5,8 @@
|
||||||
nix-janitor,
|
nix-janitor,
|
||||||
}:
|
}:
|
||||||
{
|
{
|
||||||
options.local.allowedUnfree = lib.mkOption {
|
|
||||||
type = lib.types.listOf lib.types.str;
|
|
||||||
default = [ ];
|
|
||||||
};
|
|
||||||
|
|
||||||
config = {
|
|
||||||
|
|
||||||
nixpkgs.config = {
|
|
||||||
allowAliases = false;
|
|
||||||
allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) config.local.allowedUnfree;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
nixpkgs.config.allowAliases = false;
|
||||||
local.packages = {
|
local.packages = {
|
||||||
inherit (pkgs)
|
inherit (pkgs)
|
||||||
bottom # view tasks
|
bottom # view tasks
|
||||||
|
|
@ -82,5 +72,4 @@
|
||||||
programs.command-not-found.enable = false;
|
programs.command-not-found.enable = false;
|
||||||
|
|
||||||
system.rebuild.enableNg = true;
|
system.rebuild.enableNg = true;
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
12
nixosModules/unfree.nix
Normal file
12
nixosModules/unfree.nix
Normal file
|
|
@ -0,0 +1,12 @@
|
||||||
|
{ lib, config }:
|
||||||
|
{
|
||||||
|
options.local.allowedUnfree = lib.mkOption {
|
||||||
|
type = lib.types.listOf lib.types.str;
|
||||||
|
default = [ ];
|
||||||
|
};
|
||||||
|
|
||||||
|
config = {
|
||||||
|
nixpkgs.config.allowUnfreePredicate =
|
||||||
|
pkg: builtins.elem (lib.getName pkg) config.local.allowedUnfree;
|
||||||
|
};
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue