nixos-configs/nixosModules/allowed-unfree-list.nix

18 lines
431 B
Nix
Raw Normal View History

2025-09-14 12:22:20 +02:00
{ lib, config, ... }:
{
options.my.allowedUnfreePackages = lib.mkOption {
2025-09-14 12:22:20 +02:00
type = lib.types.listOf lib.types.str;
default = [ ];
example = [ "steam" ];
};
config = {
nixpkgs.config = {
# https://github.com/NixOS/nixpkgs/issues/197325#issuecomment-1579420085
allowUnfreePredicate = lib.mkDefault (
pkg: builtins.elem (lib.getName pkg) config.my.allowedUnfreePackages
);
2025-09-14 12:22:20 +02:00
};
};
}