This commit is contained in:
parent
a0575bdb2a
commit
703bf836de
210 changed files with 1 additions and 1 deletions
26
modules/unfree-packages.nix
Normal file
26
modules/unfree-packages.nix
Normal file
|
@ -0,0 +1,26 @@
|
|||
{ config, lib, ... }:
|
||||
|
||||
{
|
||||
options.nixpkgs.allowedUnfreePackages = lib.mkOption {
|
||||
type = lib.types.listOf lib.types.str;
|
||||
default = [ ];
|
||||
};
|
||||
|
||||
config.flake = {
|
||||
modules =
|
||||
let
|
||||
predicate = pkg: builtins.elem (lib.getName pkg) config.nixpkgs.allowedUnfreePackages;
|
||||
in
|
||||
{
|
||||
nixos.pc.nixpkgs.config.allowUnfreePredicate = predicate;
|
||||
|
||||
homeManager.base = args: {
|
||||
nixpkgs.config = lib.mkIf (!(args.hasGlobalPkgs or false)) {
|
||||
allowUnfreePredicate = predicate;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
meta.nixpkgs.allowedUnfreePackages = config.nixpkgs.allowedUnfreePackages;
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue