mirror of
https://github.com/Stunkymonkey/nixos.git
synced 2025-09-13 22:12:03 +02:00
This commit is contained in:
parent
3d38e0e2b4
commit
260450b779
2 changed files with 49 additions and 0 deletions
|
@ -12,6 +12,7 @@
|
||||||
./finance
|
./finance
|
||||||
./freshrss
|
./freshrss
|
||||||
./fritzbox
|
./fritzbox
|
||||||
|
./game-stream
|
||||||
./git
|
./git
|
||||||
./grafana
|
./grafana
|
||||||
./hedgedoc
|
./hedgedoc
|
||||||
|
|
48
modules/services/game-stream/default.nix
Normal file
48
modules/services/game-stream/default.nix
Normal 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";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue