2024-02-19 15:33:35 +01:00
|
|
|
# SPDX-FileCopyrightText: 2021-2024 Simon Bruder <simon@sbruder.de>
|
2024-01-06 01:19:35 +01:00
|
|
|
#
|
|
|
|
# SPDX-License-Identifier: AGPL-3.0-or-later
|
|
|
|
|
2021-01-03 16:28:35 +01:00
|
|
|
{ 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 = {
|
2021-02-27 19:55:12 +01:00
|
|
|
nixpkgs.config.allowUnfreePredicate = (pkg: lib.elem (lib.getName pkg) (
|
2021-01-03 16:28:35 +01:00
|
|
|
lib.optionals cfg.allowAssets [
|
|
|
|
"corefonts"
|
|
|
|
"vista-fonts"
|
|
|
|
"wallpaper-unfree" # defined in users/simon/modules/sway.nix
|
|
|
|
] ++ lib.optionals cfg.allowSoftware [
|
2021-07-04 20:51:28 +02:00
|
|
|
"cups-kyocera-ecosys-m552x-p502x" # exception: the file header says MIT license, but explicitly forbids modifications WTF?
|
2022-04-01 18:20:46 +02:00
|
|
|
"makemkv" # exception: runs in sandbox, only way to get DRM garbage to work properly
|
2021-01-03 16:28:35 +01:00
|
|
|
"p7zip" # exception: rar source code is not free, but available; p7zip with `enableUnfree` includes it
|
2021-10-04 16:33:40 +02:00
|
|
|
|
2023-12-20 16:53:42 +01:00
|
|
|
# exception: used for programming the NitroKey,
|
|
|
|
# available under essentially a 3-BSD license with two additional restrictions:
|
|
|
|
# one usage restriction and one (pointless as the source is available) reverse engineering restriction
|
|
|
|
"nrfutil"
|
|
|
|
|
2021-10-04 16:33:40 +02:00
|
|
|
# games (okay if they run sandboxed)
|
|
|
|
"osu-lazer" # also is free except for one dependency
|
2021-01-03 16:28:35 +01:00
|
|
|
]
|
|
|
|
));
|
|
|
|
};
|
|
|
|
}
|