Rebase to flake parts #13

This commit is contained in:
2026-05-30 21:26:13 -03:00
parent 9a4ed1b04b
commit dcdd2c2d90
9 changed files with 245 additions and 46 deletions
+44
View File
@@ -88,6 +88,39 @@
'';
};
sunshine = {
enable = lib.mkEnableOption "Sunshine self-hosted Moonlight streaming host";
openFirewall = lib.mkOption {
type = lib.types.bool;
default = true;
description = "Open Sunshine/Moonlight ports via `services.sunshine.openFirewall`.";
};
capSysAdmin = lib.mkOption {
type = lib.types.bool;
default = true;
description = ''
Grant CAP_SYS_ADMIN to Sunshine for DRM/KMS capture (`services.sunshine.capSysAdmin`).
'';
};
autoStart = lib.mkOption {
type = lib.types.bool;
default = true;
description = "Start Sunshine with the graphical session.";
};
cudaSupport = lib.mkOption {
type = lib.types.bool;
default = false;
description = ''
Build Sunshine with CUDA/NVENC (`pkgs.sunshine.override { cudaSupport = true; }`).
Enable on NVIDIA hosts for hardware encoding.
'';
};
};
launchers = {
enableBottles = lib.mkOption {
type = lib.types.bool;
@@ -128,6 +161,17 @@
dedicatedServer.openFirewall = cfg.steam.dedicatedServer.openFirewall;
};
services.sunshine = lib.mkIf cfg.sunshine.enable {
enable = true;
openFirewall = cfg.sunshine.openFirewall;
capSysAdmin = cfg.sunshine.capSysAdmin;
autoStart = cfg.sunshine.autoStart;
package = pkgs.sunshine.override {
cudaSupport = cfg.sunshine.cudaSupport;
cudaPackages = pkgs.cudaPackages;
};
};
hardware.graphics = lib.mkIf cfg.graphics.enable {
enable = true;
enable32Bit = cfg.graphics.enable32Bit;