From 398c5fcc8a6a076e9c988faaefcd6071e848b3f0 Mon Sep 17 00:00:00 2001 From: John Ogle Date: Mon, 11 May 2026 19:47:18 -0700 Subject: [PATCH] feat(kodi): replace stremio with stremio-linux-shell and add scale factor support Migrate from Qt-based stremio to Rust/CEF-based stremio-linux-shell. Add stremioScaleFactor option (uses --force-device-scale-factor) for 4K TV display scaling. Set to 2.0 on boxy and gym-box. --- flake.nix | 2 +- machines/boxy/configuration.nix | 1 + machines/gym-box/configuration.nix | 1 + roles/kodi/default.nix | 32 ++++++++++++++++++++++++++++-- 4 files changed, 33 insertions(+), 3 deletions(-) diff --git a/flake.nix b/flake.nix index 4dabe74..869f178 100644 --- a/flake.nix +++ b/flake.nix @@ -298,7 +298,7 @@ "custom-qmd" = pkgs.custom.qmd; "qt-pinned-jellyfin-media-player" = pkgsQt.jellyfin-media-player; - "qt-pinned-stremio" = pkgsQt.stremio; + # "qt-pinned-stremio" = pkgsQt.stremio; # Replaced by stremio-linux-shell (Rust/CEF-based) } // ( if system == "x86_64-linux" then diff --git a/machines/boxy/configuration.nix b/machines/boxy/configuration.nix index fe3cc11..40c4f85 100644 --- a/machines/boxy/configuration.nix +++ b/machines/boxy/configuration.nix @@ -28,6 +28,7 @@ with lib; wayland = true; appLauncherServer.enable = true; jellyfinScaleFactor = 1.0; + stremioScaleFactor = 2.0; }; nfs-mounts.enable = true; users.enable = true; diff --git a/machines/gym-box/configuration.nix b/machines/gym-box/configuration.nix index 0dacaa1..598d61c 100644 --- a/machines/gym-box/configuration.nix +++ b/machines/gym-box/configuration.nix @@ -28,6 +28,7 @@ with lib; wayland = true; appLauncherServer.enable = true; jellyfinScaleFactor = 1.0; + stremioScaleFactor = 2.0; }; nfs-mounts.enable = true; users.enable = true; diff --git a/roles/kodi/default.nix b/roles/kodi/default.nix index d594213..3813268 100644 --- a/roles/kodi/default.nix +++ b/roles/kodi/default.nix @@ -19,6 +19,11 @@ in default = null; description = "Scale factor for Jellyfin Media Player UI (e.g., 1.5 for 150% scaling)"; }; + 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)"; + }; appLauncherServer = { enable = mkOption { type = types.bool; @@ -64,6 +69,28 @@ in ''; } else pkgs.qt-pinned.jellyfin-media-player; + + stremioPkg = + if cfg.stremioScaleFactor != null + then pkgs.symlinkJoin { + name = "stremio-scaled"; + paths = [ pkgs.stremio-linux-shell ]; + nativeBuildInputs = [ pkgs.makeWrapper ]; + postBuild = '' + 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}" + + # Update .desktop file to include scale factor + 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}" + ''; + } + else pkgs.stremio-linux-shell; in mkIf cfg.enable { users.extraUsers.kodi = { @@ -80,12 +107,13 @@ in firefox jellyfinMediaPlayerPkg kodiPkg - qt-pinned.stremio + stremioPkg + # qt-pinned.stremio # Replaced by stremio-linux-shell (Rust/CEF-based) wget ] ++ optional cfg.appLauncherServer.enable pkgs.custom.app-launcher-server; nixpkgs.config.permittedInsecurePackages = lib.warn - "Allowing insecure package qtwebengine-5.15.19 as a jellyfin-media-player/stremio dependency. These are pinned to nixpkgs-qt to avoid rebuilds - update that input separately when you have time." + "Allowing insecure package qtwebengine-5.15.19 as a jellyfin-media-player dependency. These are pinned to nixpkgs-qt to avoid rebuilds - update that input separately when you have time." [ "qtwebengine-5.15.19" ];