Update stremio-linux-shell to use unstable for Rust 1.92+

This commit is contained in:
2026-05-11 20:57:29 -07:00
parent d74a8a4a39
commit c12ef9e01e
7 changed files with 65 additions and 14 deletions
+5
View File
@@ -36,6 +36,11 @@ in
# Xbox wireless protocol support (PDP RiffMaster Xbox, Xbox controllers, etc.)
hardware.xone.enable = true;
# Disable USB autosuspend — xone-wired PDP RiffMaster guitars disconnect
# when the kernel suspends the USB device after 2s of idle, then fail to
# wake on button press (connect/disconnect loop in dmesg).
boot.kernelParams = [ "usbcore.autosuspend=-1" ];
# YARG (rhythm game) needs udev rules for HID controller access.
# Without these, instruments (Wii, PS3, etc.) can't be read without
# sudo, and Steam's input layer must be used as a workaround (which
+21 -4
View File
@@ -22,7 +22,7 @@ in
stremioScaleFactor = mkOption {
type = types.nullOr types.float;
default = null;
description = "Scale factor for Stremio UI via --force-device-scale-factor (e.g., 2 for 200% scaling)";
description = "Scale factor for Stremio UI via GDK_BACKEND=x11 + GDK_SCALE (e.g., 2.0 for 200% scaling). Forces XWayland mode since GTK4 ignores GDK_SCALE on native Wayland.";
};
appLauncherServer = {
enable = mkOption {
@@ -70,6 +70,22 @@ in
}
else pkgs.qt-pinned.jellyfin-media-player;
# stremio-linux-shell is a GTK4/libadwaita + WebKitGTK app (not Electron/CEF).
# --force-device-scale-factor is a Chromium flag that it ignores entirely.
# On Wayland, GTK4 reads scale from the compositor via wp_fractional_scale_v1.
# To force a specific scale, we use GDK_BACKEND=x11 + GDK_SCALE which works
# reliably under XWayland. On native Wayland, GDK_SCALE is ignored.
# Format floats cleanly: 2.0 -> "2", 1.5 -> "1.5"
stremioScaleStr = let
sf = cfg.stremioScaleFactor;
intPart = builtins.floor sf;
s = builtins.toString sf;
m = builtins.match "([0-9]+)\\.([0-9]*[1-9])0*" s;
gdkScale = builtins.toString intPart;
in if sf == intPart then builtins.toString intPart
else if m != null then (builtins.elemAt m 0) + "." + (builtins.elemAt m 1)
else s;
stremioPkg =
if cfg.stremioScaleFactor != null
then pkgs.symlinkJoin {
@@ -80,14 +96,15 @@ in
mkdir -p $out/bin
rm -f $out/bin/stremio
makeWrapper ${pkgs.stremio-linux-shell}/bin/stremio $out/bin/stremio \
--add-flags "--force-device-scale-factor=${toString cfg.stremioScaleFactor}"
--set GDK_BACKEND x11 \
--set GDK_SCALE ${builtins.toString (builtins.floor cfg.stremioScaleFactor)}
# Update .desktop file to include scale factor
# Update .desktop file to force XWayland + GDK_SCALE for scaling
mkdir -p $out/share/applications
rm -f $out/share/applications/com.stremio.Stremio.desktop
substitute ${pkgs.stremio-linux-shell}/share/applications/com.stremio.Stremio.desktop \
$out/share/applications/com.stremio.Stremio.desktop \
--replace-fail "Exec=stremio" "Exec=stremio --force-device-scale-factor=${toString cfg.stremioScaleFactor}"
--replace-fail "Exec=sh -c " "Exec=env GDK_BACKEND=x11 GDK_SCALE=${builtins.toString (builtins.floor cfg.stremioScaleFactor)} sh -c "
'';
}
else pkgs.stremio-linux-shell;