From ed70646087e1e190da94b5c900c5bb9f9d1eadc8 Mon Sep 17 00:00:00 2001 From: Giulio De Pasquale Date: Tue, 2 Apr 2024 16:41:15 +0100 Subject: [PATCH] sunshine: fixed resolution script invocation, use fixed fork for framepacing --- hosts/architect/sunshine-ui.patch | 16 ++++++++++++++++ hosts/architect/sunshine.nix | 21 +++++++++++++++++---- 2 files changed, 33 insertions(+), 4 deletions(-) create mode 100644 hosts/architect/sunshine-ui.patch diff --git a/hosts/architect/sunshine-ui.patch b/hosts/architect/sunshine-ui.patch new file mode 100644 index 0000000..52d33a6 --- /dev/null +++ b/hosts/architect/sunshine-ui.patch @@ -0,0 +1,16 @@ +diff --git a/cmake/targets/unix.cmake b/cmake/targets/unix.cmake +index 2ce0378..cdbf65c 100644 +--- a/cmake/targets/unix.cmake ++++ b/cmake/targets/unix.cmake +@@ -2,7 +2,7 @@ + # put anything here that applies to both linux and macos + + #WebUI build +-add_custom_target(web-ui ALL +- WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}" +- COMMENT "Installing NPM Dependencies and Building the Web UI" +- COMMAND bash -c \"npm install && SUNSHINE_BUILD_HOMEBREW=${NPM_BUILD_HOMEBREW} SUNSHINE_SOURCE_ASSETS_DIR=${NPM_SOURCE_ASSETS_DIR} SUNSHINE_ASSETS_DIR=${NPM_ASSETS_DIR} npm run build\") # cmake-lint: disable=C0301 ++# add_custom_target(web-ui ALL ++# WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}" ++# COMMENT "Installing NPM Dependencies and Building the Web UI" ++# COMMAND bash -c \"npm install && SUNSHINE_BUILD_HOMEBREW=${NPM_BUILD_HOMEBREW} SUNSHINE_SOURCE_ASSETS_DIR=${NPM_SOURCE_ASSETS_DIR} SUNSHINE_ASSETS_DIR=${NPM_ASSETS_DIR} npm run build\") # cmake-lint: disable=C0301 diff --git a/hosts/architect/sunshine.nix b/hosts/architect/sunshine.nix index d52be72..a7cc182 100644 --- a/hosts/architect/sunshine.nix +++ b/hosts/architect/sunshine.nix @@ -16,8 +16,8 @@ let text = '' #!${pkgs.bash}/bin/bash - width=''${1:-1920} - height=''${2:-1080} + width=''${1:-1280} + height=''${2:-720} refresh_rate=''${3:-120} # Get the modeline info from the 2nd row in the cvt output @@ -48,9 +48,22 @@ let origin_web_ui_allowed=lan channels=2 min_threads=12 - global_prep_cmd=[{"do":"${resolutionScript}/bin/resolution.sh ''${SUNSHINE_CLIENT_WIDTH} ''${SUNSHINE_CLIENT_HEIGHT} ''${SUNSHINE_CLIENT_FPS}"}] + + global_prep_cmd=[{"do":"${pkgs.bash}/bin/bash -c \"${resolutionScript}/bin/resolution.sh ''${SUNSHINE_CLIENT_WIDTH} ''${SUNSHINE_CLIENT_HEIGHT} ''${SUNSHINE_CLIENT_FPS}\""}] ''; - sunshinePkg = pkgs.unstablePkgs.sunshine.override { cudaSupport = true; }; + sunshinePkg = (pkgs.unstablePkgs.sunshine.override { cudaSupport = true; }).overrideAttrs (old: { + version = "0.22.2-fix"; + src = pkgs.fetchFromGitHub { + owner = "gschintgen"; + repo = "Sunshine"; + rev = "985561c5cfe0934662a90f9b6c406e3f3e981d59"; + sha256 = "sha256-APfwDkVG1uYvfqxNjNxGEofDd4H0QAk5fzAKG6IW+CI="; + fetchSubmodules = true; + }; + patches = [./sunshine-ui.patch]; + + buildInputs = old.buildInputs ++ [pkgs.python311]; + }); in { boot.kernelModules = [ "uinput" ];