Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sunshine: 0.23.0 -> 0.23.1 #306655

Merged
merged 2 commits into from
May 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions nixos/modules/services/networking/sunshine.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{ config, lib, pkgs, utils, ... }:
let
inherit (lib) mkEnableOption mkPackageOption mkOption mkIf mkDefault types optionals getExe;
inherit (lib) mkEnableOption mkPackageOption mkOption literalExpression mkIf mkDefault types optionals getExe;
inherit (utils) escapeSystemdExecArgs;
cfg = config.services.sunshine;

Expand Down Expand Up @@ -39,7 +39,7 @@ in

See https://docs.lizardbyte.dev/projects/sunshine/en/latest/about/advanced_usage.html#configuration for syntax.
'';
example = ''
example = literalExpression ''
{
sunshine_name = "nixos";
}
Expand All @@ -60,7 +60,7 @@ in
description = ''
Configuration for applications to be exposed to Moonlight. If this is set, no configuration is possible from the web UI, and must be by the `settings` option.
'';
example = ''
example = literalExpression ''
{
env = {
PATH = "$(PATH):$(HOME)/.local/bin";
Expand Down
22 changes: 14 additions & 8 deletions pkgs/servers/sunshine/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -52,26 +52,21 @@ let
in
stdenv'.mkDerivation rec {
pname = "sunshine";
version = "0.23.0";
version = "0.23.1";

src = fetchFromGitHub {
owner = "LizardByte";
repo = "Sunshine";
rev = "v${version}";
sha256 = "sha256-K43LZ7zouTRUI4xhiHuRzu2tN7mUl1nTapuR34JR/Ac=";
sha256 = "sha256-D5ee5m2ZTKVqZDH07nzJuFEbZBQ4xW7m4nYnJQe0EaA=";
fetchSubmodules = true;
};

patches = [
# remove npm install as it needs internet access -- handled separately below
./dont-build-webui.patch
];

# build webui
ui = buildNpmPackage {
inherit src version;
pname = "sunshine-ui";
npmDepsHash = "sha256-I7IrCR7eQ97a8cPB8F8+T0zX8iJcwh+YtZ9QRtEVZtI=";
npmDepsHash = "sha256-9FuMtxTwrU9UIhZXQn/tmGN0IHZBdunV0cY/EElj4bA=";

# use generated package-lock.json as upstream does not provide one
postPatch = ''
Expand Down Expand Up @@ -176,12 +171,23 @@ stdenv'.mkDerivation rec {
cp -r ${ui}/build ../
'';

buildFlags = [
"sunshine"
];

# allow Sunshine to find libvulkan
postFixup = lib.optionalString cudaSupport ''
wrapProgram $out/bin/sunshine \
--set LD_LIBRARY_PATH ${lib.makeLibraryPath [ vulkan-loader ]}
'';

# redefine installPhase to avoid attempt to build webui
installPhase = ''
runHook preInstall
cmake --install .
runHook postInstall
'';

postInstall = ''
install -Dm644 ../packaging/linux/${pname}.desktop $out/share/applications/${pname}.desktop
'';
Expand Down
13 changes: 0 additions & 13 deletions pkgs/servers/sunshine/dont-build-webui.patch

This file was deleted.

163 changes: 80 additions & 83 deletions pkgs/servers/sunshine/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.