nixos-config/modules/unfree.nix
Simon Bruder 8b9eb54806
games: Conditionally add emulators
This uses a crude arbitrary number to only install them onto machines
that can actually run them.
2021-07-26 20:44:46 +02:00

41 lines
1.4 KiB
Nix

{ config, lib, ... }:
let
cfg = config.sbruder.unfree;
in
{
# Options that affect multiple modules
options.sbruder = {
unfree = {
allowAssets = lib.mkOption {
default = true;
type = lib.types.bool;
description = "Allow restricted selection of unfree assets to be installed.";
};
allowSoftware = lib.mkOption {
default = false;
type = lib.types.bool;
description = "Allow restricted selection of unfree software to be installed.";
};
};
};
config = {
nixpkgs.config.allowUnfreePredicate = (pkg: lib.elem (lib.getName pkg) (
lib.optionals cfg.allowAssets [
"corefonts"
"vista-fonts"
"wallpaper-unfree" # defined in users/simon/modules/sway.nix
"yuzu-ea"
"yuzu-mainline" # derivation of icons is not allowed
] ++ lib.optionals cfg.allowSoftware [
"cups-kyocera-ecosys-m552x-p502x" # exception: the file header says MIT license, but explicitly forbids modifications WTF?
"drone-runner-exec" # exception: same as drone.io
"drone.io" # exception: is open source (but has usage restriction)
"fahclient" # exception: for science
"osu-lazer" # exception: is mostly free (just has one unfree dependency) and runs in container
"p7zip" # exception: rar source code is not free, but available; p7zip with `enableUnfree` includes it
]
));
};
}