service/game-stream: init
Some checks failed
/ Build Nix targets (push) Has been cancelled

This commit is contained in:
Felix Buehler 2025-08-20 23:14:36 +02:00
parent 3d38e0e2b4
commit 260450b779
2 changed files with 49 additions and 0 deletions

View file

@ -12,6 +12,7 @@
./finance ./finance
./freshrss ./freshrss
./fritzbox ./fritzbox
./game-stream
./git ./git
./grafana ./grafana
./hedgedoc ./hedgedoc

View file

@ -0,0 +1,48 @@
{
config,
lib,
pkgs,
...
}:
let
cfg = config.my.services.game-stream;
in
{
options.my.services.game-stream = {
enable = lib.mkEnableOption "game-streaming-server";
};
config = lib.mkIf cfg.enable {
environment.systemPackages = [
pkgs.sunshine
];
services.udev.packages = [ pkgs.sunshine ];
networking.firewall = {
enable = true;
allowedTCPPorts = [
47984
47989
47990
48010
];
allowedUDPPortRanges = [
{
from = 47998;
to = 48000;
}
{
from = 8000;
to = 8010;
}
];
};
# Prevents this error:
# Fatal: You must run [sudo setcap cap_sys_admin+p $(readlink -f sunshine)] for KMS display capture to work!
security.wrappers.sunshine = {
owner = "root";
group = "root";
capabilities = "cap_sys_admin+p";
source = "${pkgs.sunshine}/bin/sunshine";
};
};
}