From bbbe35e879038519b9db6b497016460257ea678f Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Wed, 5 Aug 2026 07:37:33 +0000 Subject: [PATCH] invidious: minor cleanup --- pkgs/by-name/in/invidious/package.nix | 44 +++++++++++++++++---------- 1 file changed, 28 insertions(+), 16 deletions(-) diff --git a/pkgs/by-name/in/invidious/package.nix b/pkgs/by-name/in/invidious/package.nix index 0ee9467420dc..96353a25ddf6 100644 --- a/pkgs/by-name/in/invidious/package.nix +++ b/pkgs/by-name/in/invidious/package.nix @@ -57,28 +57,40 @@ crystal.buildCrystalPackage rec { in '' for d in ${videojs}/*; do ln -s "$d" assets/videojs; done - - # Use the version metadata from the derivation instead of using git at - # build-time + '' + # Use the version metadata from the derivation instead of using git at + # build-time + + '' substituteInPlace src/invidious.cr \ - --replace-fail ${lib.escapeShellArg branchTemplate} '"master"' \ - --replace-fail ${lib.escapeShellArg commitTemplate} '"${commit}"' \ - --replace-fail ${lib.escapeShellArg versionTemplate} '"${date}"' \ - --replace-fail ${lib.escapeShellArg assetCommitTemplate} '"${commit}"' \ - --replace-fail ${lib.escapeShellArg tagTemplate} '"v${version}"' - - # Patch the assets and locales paths to be absolute + --replace-fail ${lib.escapeShellArg branchTemplate} '"master"' \ + --replace-fail ${lib.escapeShellArg commitTemplate} '"${commit}"' \ + --replace-fail ${lib.escapeShellArg versionTemplate} '"${date}"' \ + --replace-fail ${lib.escapeShellArg assetCommitTemplate} '"${commit}"' \ + --replace-fail ${lib.escapeShellArg tagTemplate} '"v${version}"' + '' + # Patch the assets and locales paths to be absolute + + '' substituteInPlace src/invidious.cr \ - --replace-fail 'StaticAssetsHandler.new("assets"' 'StaticAssetsHandler.new("${placeholder "out"}/share/invidious/assets"' + --replace-fail \ + 'StaticAssetsHandler.new("assets"' \ + 'StaticAssetsHandler.new("${placeholder "out"}/share/invidious/assets"' + substituteInPlace src/invidious/helpers/i18n.cr \ - --replace-fail 'File.read("locales/' 'File.read("${placeholder "out"}/share/invidious/locales/' - - # Reference sql initialisation/migration scripts by absolute path + --replace-fail \ + 'File.read("locales/' \ + 'File.read("${placeholder "out"}/share/invidious/locales/' + '' + # Reference sql initialisation/migration scripts by absolute path + + '' substituteInPlace src/invidious/database/base.cr \ - --replace-fail 'config/sql' '${placeholder "out"}/share/invidious/config/sql' + --replace-fail \ + 'config/sql' \ + '${placeholder "out"}/share/invidious/config/sql' substituteInPlace src/invidious/user/captcha.cr \ - --replace-fail 'Process.run(%(rsvg-convert' 'Process.run(%(${lib.getBin librsvg}/bin/rsvg-convert' + --replace-fail \ + 'Process.run(%(rsvg-convert' \ + 'Process.run(%(${lib.getBin librsvg}/bin/rsvg-convert' ''; nativeBuildInputs = [