remove sunshine service from gaming module
This commit is contained in:
parent
759fb4e721
commit
c2f01a8cc7
@ -3,65 +3,6 @@ inputs:
|
||||
with lib;
|
||||
let
|
||||
cfg = config.gaming;
|
||||
|
||||
sunshineSrc = pkgs.fetchFromGitHub {
|
||||
owner = "loki-47-6F-64";
|
||||
repo = "sunshine";
|
||||
rev = "e4c9c292e57d39136df2d46d1e9b66eba53f3bd3";
|
||||
sha256 = "sha256-YrQHHpw7GOcdlnyJI28VShYFrTRq7kpILnkyCYf77NE=";
|
||||
fetchSubmodules = true;
|
||||
};
|
||||
|
||||
sunshineAssets = pkgs.runCommandNoCC "sunshine-assets" { } ''
|
||||
cp -r ${sunshineSrc}/assets $out
|
||||
'';
|
||||
|
||||
sunshine = pkgs.stdenv.mkDerivation {
|
||||
name = "sunshine";
|
||||
src = sunshineSrc;
|
||||
|
||||
cmakeFlags = [ "-DSUNSHINE_ASSETS_DIR=assets" "-DSUNSHINE_DEFAULT_DIR=${sunshineAssets}" ];
|
||||
|
||||
postPatch = ''
|
||||
substituteInPlace CMakeLists.txt \
|
||||
--replace '/usr/include/libevdev-1.0' '${pkgs.libevdev}/include/libevdev-1.0'
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out/bin
|
||||
cp sunshine $out/bin
|
||||
|
||||
mkdir -p $out/etc
|
||||
cp -r ../assets $out/etc
|
||||
'';
|
||||
|
||||
postFixup = ''
|
||||
wrapProgram $out/bin/sunshine --prefix LD_LIBRARY_PATH ":" "/run/opengl-driver/lib"
|
||||
'';
|
||||
|
||||
nativeBuildInputs = with pkgs; [ cmake pkgconfig makeWrapper ];
|
||||
hardeningDisable = [ "format" ];
|
||||
|
||||
buildInputs = with pkgs; [
|
||||
icu
|
||||
openssl
|
||||
(boost.override { enableShared = false; enableStatic = true; })
|
||||
wayland
|
||||
valgrind
|
||||
libffi
|
||||
ffmpeg
|
||||
libevdev
|
||||
libcap
|
||||
libdrm
|
||||
libpulseaudio
|
||||
libopus
|
||||
cudaPackages_11_4.cudatoolkit
|
||||
xorg.libXrandr
|
||||
xorg.libXfixes
|
||||
xorg.libXtst
|
||||
xorg.libxcb
|
||||
];
|
||||
};
|
||||
in
|
||||
{
|
||||
options.gaming = {
|
||||
@ -73,11 +14,6 @@ in
|
||||
description = "If you want to include wine-staging as new-wine";
|
||||
};
|
||||
|
||||
sunshineService = mkOption {
|
||||
type = types.bool;
|
||||
description = "Enable sunshine game streaming service";
|
||||
};
|
||||
|
||||
steamService = mkOption {
|
||||
type = types.bool;
|
||||
description = "Enable running steam as a service";
|
||||
@ -90,8 +26,7 @@ in
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
gaming.sunshineService = mkOptionDefault false;
|
||||
gaming.steamService = mkOptionDefault cfg.sunshineService;
|
||||
gaming.steamService = mkOptionDefault false;
|
||||
gaming.scService = mkOptionDefault cfg.steamService;
|
||||
|
||||
home.sessionVariables = {
|
||||
@ -143,41 +78,6 @@ in
|
||||
)
|
||||
] ++ lib.optional cfg.steamService (pkgs.writeShellScriptBin "steam" "${pkgs.systemd}/bin/systemctl --user start steam");
|
||||
|
||||
systemd.user.services.sunshine = mkIf cfg.sunshineService {
|
||||
Unit = {
|
||||
Description = "Host for Moonlight Streaming Client";
|
||||
Requires = [ "dbus.service" ];
|
||||
After = [ "graphical-session-pre.target" "network.target" ];
|
||||
PartOf = [ "graphical-session.target" ];
|
||||
};
|
||||
|
||||
Install = {
|
||||
WantedBy = [ "graphical-session.target" ];
|
||||
};
|
||||
|
||||
Service = {
|
||||
WorkingDirectory = "${config.xdg.configHome}/sunshine";
|
||||
Restart = "on-failure";
|
||||
RestartSec = 3;
|
||||
ExecStart = "${sunshine}/bin/sunshine";
|
||||
ExecStartPre =
|
||||
let
|
||||
script = pkgs.writeShellScript "sunshine-pre-start" ''
|
||||
${pkgs.coreutils}/bin/mkdir -p $HOME/.config/sunshine/assets
|
||||
|
||||
${pkgs.coreutils}/bin/rm -rf $HOME/.config/sunshine/assets/shaders
|
||||
${pkgs.coreutils}/bin/rm -rf $HOME/.config/sunshine/assets/web
|
||||
${pkgs.coreutils}/bin/rm -rf $HOME/.config/sunshine/assets/box.png
|
||||
|
||||
${pkgs.coreutils}/bin/cp --no-preserve=all -r ${sunshineAssets}/shaders $HOME/.config/sunshine/assets
|
||||
${pkgs.coreutils}/bin/cp --no-preserve=all -r ${sunshineAssets}/web $HOME/.config/sunshine/assets
|
||||
${pkgs.coreutils}/bin/cp --no-preserve=all ${sunshineAssets}/box.png $HOME/.config/sunshine/assets
|
||||
'';
|
||||
in
|
||||
"${script}";
|
||||
};
|
||||
};
|
||||
|
||||
systemd.user.services.scc = mkIf cfg.scService {
|
||||
Unit = {
|
||||
Description = "User-mode driver and GTK3 based GUI for Steam Controller";
|
||||
|
Loading…
Reference in New Issue
Block a user