dotfiles/modules/unfree/default.nix

18 lines
381 B
Nix
Raw Normal View History

2024-07-18 11:48:49 +00:00
{ lib, config, pkgs, ... }:
with lib;
let
cfg = config.modules.unfree;
in {
options.modules.unfree = {
enable = mkEnableOption "unfree";
allowedPackages = mkOption {
type = types.listOf types.str;
default = [];
};
};
config = mkIf cfg.enable {
nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (getName pkg) cfg.allowedPackages;
};
}