nixos-config/modules/unfree.nix
Simon Bruder 5375a858bd
Replace steam with flatpak
I am no longer willing to accept hours upon hours of debugging just to
get the client to work. I don’t get why they would ship a 32-bit GTK2
executable that uses CEF with its sandbox disabled in 2024. Obviously,
this makes debugging quite hard as things don’t work well, even when
they work. This leaves red herrings everywhere (“Is this segfault a
symptom of the issue I’m facing or is that also happening to other users
where it works fine?”).

Flatpak also seems to have quite good sandboxing features when Flatseal
is used for every application to take away any unnecessary permissions.
2024-02-23 19:21:11 +01:00

48 lines
1.6 KiB
Nix

# SPDX-FileCopyrightText: 2021-2024 Simon Bruder <simon@sbruder.de>
#
# SPDX-License-Identifier: AGPL-3.0-or-later
{ 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
] ++ lib.optionals cfg.allowSoftware [
"cups-kyocera-ecosys-m552x-p502x" # exception: the file header says MIT license, but explicitly forbids modifications WTF?
"makemkv" # exception: runs in sandbox, only way to get DRM garbage to work properly
"p7zip" # exception: rar source code is not free, but available; p7zip with `enableUnfree` includes it
# 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"
# games (okay if they run sandboxed)
"osu-lazer" # also is free except for one dependency
]
));
};
}