sunshine: something something
This commit is contained in:
parent
23e5723ccb
commit
5d881826d1
@ -1,6 +1,16 @@
|
||||
{ config, pkgs, ... }:
|
||||
|
||||
let
|
||||
# nvidia-patch
|
||||
rev = "b63013c"; # revision from https://github.com/keylase/nvidia-patch to use
|
||||
hash = "sha256-EDPoMTj3J1f/7Sv/q7P/lZ4r2aXOCdsbZ4FumbvuCWk="; # sha256sum for https://github.com/keylase/nvidia-patch at the specified revision
|
||||
|
||||
# create patch functions for the specified revision
|
||||
nvidia-patch = pkgs.nvidia-patch rev hash;
|
||||
|
||||
# nvidia package to patch
|
||||
nvidiaPackage = config.boot.kernelPackages.nvidiaPackages.stable;
|
||||
|
||||
user = "sunshine";
|
||||
resolutionScript = pkgs.writeTextFile {
|
||||
name = "sunshine-resolution-script";
|
||||
@ -37,7 +47,7 @@ let
|
||||
min_threads=12
|
||||
global_prep_cmd=[{"do":"${pkgs.bash}/bin/bash -c \"${resolutionScript}/bin/resolution.sh ''${SUNSHINE_CLIENT_WIDTH} ''${SUNSHINE_CLIENT_HEIGHT} ''${SUNSHINE_CLIENT_FPS}\""}]
|
||||
'';
|
||||
sunshineOverride = pkgs.sunshine.override { cudaSupport = true; stdenv = pkgs.cudaPackages.backendStdenv; };
|
||||
sunshineOverride = pkgs.unstablePkgs.sunshine.override { cudaSupport = true; };
|
||||
in
|
||||
{
|
||||
security = {
|
||||
@ -54,18 +64,13 @@ in
|
||||
'';
|
||||
};
|
||||
|
||||
systemd.targets = {
|
||||
sleep.enable = false;
|
||||
suspend.enable = false;
|
||||
hibernate.enable = false;
|
||||
hybrid-sleep.enable = false;
|
||||
};
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
sunshineOverride
|
||||
xorg.xrandr
|
||||
xorg.xorgserver
|
||||
xorg.libxcvt
|
||||
gamemode
|
||||
];
|
||||
sound.enable = true;
|
||||
|
||||
@ -132,20 +137,28 @@ in
|
||||
openssh.authorizedKeys.keys = [ "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQC1we38/N+t8Ah5yrLof8QUwhrob7/VXFKIddaJeOVBLuDVnW7ljiAtdtEiL69D/DV4Ohmt5wMvkAAjfuHmim6FD9A6lzPbSU4KH9W2dcckszKbbI636kuDwem/xui6BW3wJa6P+0xW5ksygEAkzcK2PXuC2b4B9uwhuUdKahiGMKDxISG/WianqAe72cGMfNkYvion3Y1VsMLUdm48d2ABnxNpr7NI9B5iJ8dziOft9gpgfz13CCQRlReo75gk/4xI+vSNrQp7eR+wzJy2/dZg/T8jtyA9Q6jVxrxBpqQ1LNXkAKaJkGo9OabF6Wgpzp+YTAurL4nwR2NaJxwFuyoKvACQy0ai4jrS3206gC6JXZv8ktZMZrwUN+jPqCwfgh5qObFkAqKCxbp52ioDek2MQLdOvzQBX//DBhGEp5rzHGLZ3vhRIiiQiaof5sF5zWiYDW5mqezSPNxJPX/BrTP/Wbs/jpwTLBh3wytiia0S1WXQmya89bqzTPFiDWvTRA62EVKB/JaQtPQQOFAxWwg799DMycPeZ81xttZOyMtI/MZSddyqx2S8fWGwvToZQvuZ38mSIpFseLM1IkgabRIrAmat5SBNGGy9Dqa0eMEa7bwIY/4CMB1y6HMTnaoMXA6cnQfHMoB/zyTZ6oTXIeqeOyiZsK+RN0Mvahj8mXi7dw== giulio@giulio-X230" ];
|
||||
};
|
||||
|
||||
systemd = {
|
||||
targets = {
|
||||
sleep.enable = false;
|
||||
suspend.enable = false;
|
||||
hibernate.enable = false;
|
||||
hybrid-sleep.enable = false;
|
||||
};
|
||||
|
||||
systemd.user.services.${user} = {
|
||||
description = "Sunshine server";
|
||||
wantedBy = [ "graphical-session.target" ];
|
||||
startLimitIntervalSec = 500;
|
||||
startLimitBurst = 5;
|
||||
partOf = [ "graphical-session.target" ];
|
||||
wants = [ "graphical-session.target" ];
|
||||
after = [ "graphical-session.target" ];
|
||||
path = [ resolutionScript pkgs.xorg.xrandr pkgs.bash pkgs.xorg.libxcvt pkgs.xorg.xorgserver pkgs.gawk ];
|
||||
serviceConfig = {
|
||||
ExecStart = "${sunshineOverride}/bin/sunshine ${configFile}";
|
||||
Restart = "on-failure";
|
||||
RestartSec = "5s";
|
||||
user.services.${user} = {
|
||||
description = "Sunshine server";
|
||||
wantedBy = [ "graphical-session.target" ];
|
||||
startLimitIntervalSec = 500;
|
||||
startLimitBurst = 5;
|
||||
partOf = [ "graphical-session.target" ];
|
||||
wants = [ "graphical-session.target" ];
|
||||
after = [ "graphical-session.target" ];
|
||||
path = with pkgs; [ resolutionScript xorg.xrandr bash xorg.libxcvt xorg.xorgserver gawk gamemode ];
|
||||
serviceConfig = {
|
||||
ExecStart = "${sunshineOverride}/bin/sunshine ${configFile}";
|
||||
Restart = "on-failure";
|
||||
RestartSec = "5s";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
@ -168,6 +181,7 @@ in
|
||||
powerManagement.finegrained = false;
|
||||
open = false;
|
||||
nvidiaSettings = true;
|
||||
package = nvidia-patch.patch-nvenc (nvidia-patch.patch-fbc nvidiaPackage);
|
||||
};
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user