From 41514f65052969816e8281635e997baf453df836 Mon Sep 17 00:00:00 2001 From: blokyk Date: Wed, 28 Jan 2026 00:04:00 +0000 Subject: [PATCH 1/2] syncyomi: refactor derivation 1. use finalAttrs param instead of rec attrs using a "fix-point" style derivation that takes a self arg (aka finalAttrs) makes it easier to override things for consumers than when using a `rec` attr set, which is just syntactic sugar and doesn't propagate overriding. this is especially useful since the the build's ldflags and the web sub-derivation definition both used the `src` and `version` attributes. 2. refact esbuild override the derivation forces esbuild to be the same version as declared in its web/pnpm-lock.yaml file, but it did it by overriding the definition of `buildGoModule` used by the esbuild drv. however, it seems like this was unecessary, since just doing .overrideAttrs also worked fine for changing the esbuild version. --- pkgs/by-name/sy/syncyomi/package.nix | 54 +++++++++++++--------------- 1 file changed, 25 insertions(+), 29 deletions(-) diff --git a/pkgs/by-name/sy/syncyomi/package.nix b/pkgs/by-name/sy/syncyomi/package.nix index 32ba628f6774..28f56fe9124b 100644 --- a/pkgs/by-name/sy/syncyomi/package.nix +++ b/pkgs/by-name/sy/syncyomi/package.nix @@ -9,26 +9,40 @@ pnpmConfigHook, esbuild, }: -buildGoModule rec { +let + lockedEsbuild = esbuild.overrideAttrs ( + finalAttrs: prevAttrs: { + version = "0.17.19"; + src = fetchFromGitHub { + owner = "evanw"; + repo = "esbuild"; + rev = "v${finalAttrs.version}"; + hash = "sha256-PLC7OJLSOiDq4OjvrdfCawZPfbfuZix4Waopzrj8qsU="; + }; + vendorHash = "sha256-+BfxCyg0KkDQpHt/wycy/8CTG6YBA/VJvJFhhzUnSiQ="; + } + ); +in +buildGoModule (finalAttrs: { pname = "syncyomi"; version = "1.1.2"; src = fetchFromGitHub { owner = "SyncYomi"; repo = "SyncYomi"; - tag = "v${version}"; + tag = "v${finalAttrs.version}"; hash = "sha256-PPE6UXHo2ZlN0A0VkUH+8pkdfm6WEvpofusk6c3RBHk="; }; vendorHash = "sha256-/rpT6SatIZ+GVzmVg6b8Zy32pGybprObotyvEgvdL2w="; - web = stdenvNoCC.mkDerivation (finalAttrs: { - pname = "${pname}-web"; - inherit src version; - sourceRoot = "${finalAttrs.src.name}/web"; + web = stdenvNoCC.mkDerivation (webFinalAttrs: { + pname = "${finalAttrs.pname}-web"; + inherit (finalAttrs) src version; + sourceRoot = "${webFinalAttrs.src.name}/web"; pnpmDeps = fetchPnpmDeps { - inherit (finalAttrs) + inherit (webFinalAttrs) pname version src @@ -45,25 +59,7 @@ buildGoModule rec { pnpm_9 ]; - env.ESBUILD_BINARY_PATH = lib.getExe ( - esbuild.override { - buildGoModule = - args: - buildGoModule ( - args - // rec { - version = "0.17.19"; - src = fetchFromGitHub { - owner = "evanw"; - repo = "esbuild"; - rev = "v${version}"; - hash = "sha256-PLC7OJLSOiDq4OjvrdfCawZPfbfuZix4Waopzrj8qsU="; - }; - vendorHash = "sha256-+BfxCyg0KkDQpHt/wycy/8CTG6YBA/VJvJFhhzUnSiQ="; - } - ); - } - ); + env.ESBUILD_BINARY_PATH = lib.getExe lockedEsbuild; buildPhase = '' runHook preBuild @@ -85,7 +81,7 @@ buildGoModule rec { ldflags = [ "-s" "-w" - "-X main.version=v${version}" + "-X main.version=v${finalAttrs.version}" ]; postInstall = lib.optionalString (!stdenvNoCC.hostPlatform.isDarwin) '' @@ -95,10 +91,10 @@ buildGoModule rec { meta = { description = "Open-source project to synchronize Tachiyomi manga reading progress and library across multiple devices"; homepage = "https://github.com/SyncYomi/SyncYomi"; - changelog = "https://github.com/SyncYomi/SyncYomi/releases/tag/v${version}"; + changelog = "https://github.com/SyncYomi/SyncYomi/releases/tag/v${finalAttrs.version}"; license = lib.licenses.gpl2Only; maintainers = with lib.maintainers; [ eriedaberrie ]; mainProgram = "syncyomi"; platforms = lib.platforms.linux ++ lib.platforms.darwin; }; -} +}) From c2b51e4e65673edc6f5a0d3e34676d3c20deb9db Mon Sep 17 00:00:00 2001 From: blokyk Date: Wed, 28 Jan 2026 17:11:20 +0000 Subject: [PATCH 2/2] syncyomi: 1.1.2 -> 1.1.4 --- pkgs/by-name/sy/syncyomi/package.nix | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pkgs/by-name/sy/syncyomi/package.nix b/pkgs/by-name/sy/syncyomi/package.nix index 28f56fe9124b..08767a2d5635 100644 --- a/pkgs/by-name/sy/syncyomi/package.nix +++ b/pkgs/by-name/sy/syncyomi/package.nix @@ -12,12 +12,12 @@ let lockedEsbuild = esbuild.overrideAttrs ( finalAttrs: prevAttrs: { - version = "0.17.19"; + version = "0.19.11"; src = fetchFromGitHub { owner = "evanw"; repo = "esbuild"; rev = "v${finalAttrs.version}"; - hash = "sha256-PLC7OJLSOiDq4OjvrdfCawZPfbfuZix4Waopzrj8qsU="; + hash = "sha256-NUwjzOpHA0Ijuh0E69KXx8YVS5GTnKmob9HepqugbIU="; }; vendorHash = "sha256-+BfxCyg0KkDQpHt/wycy/8CTG6YBA/VJvJFhhzUnSiQ="; } @@ -25,16 +25,16 @@ let in buildGoModule (finalAttrs: { pname = "syncyomi"; - version = "1.1.2"; + version = "1.1.4"; src = fetchFromGitHub { owner = "SyncYomi"; repo = "SyncYomi"; tag = "v${finalAttrs.version}"; - hash = "sha256-PPE6UXHo2ZlN0A0VkUH+8pkdfm6WEvpofusk6c3RBHk="; + hash = "sha256-pU3zxzixKoYnJsGpfvC/SVWIu0adsaiiVcLn0IZe64w="; }; - vendorHash = "sha256-/rpT6SatIZ+GVzmVg6b8Zy32pGybprObotyvEgvdL2w="; + vendorHash = "sha256-fzPEljXFskr1/qzTsnASFNNc+8vA7kqO21mhMqwT44w="; web = stdenvNoCC.mkDerivation (webFinalAttrs: { pname = "${finalAttrs.pname}-web"; @@ -50,7 +50,7 @@ buildGoModule (finalAttrs: { ; pnpm = pnpm_9; fetcherVersion = 1; - hash = "sha256-edcZIqshnvM3jJpZWIR/UncI0VCMLq26h/n3VvV/384="; + hash = "sha256-Gg4nOxqWb692GvvwE7AJKQzGrrLLW7haaooEkUZW7FQ="; }; nativeBuildInputs = [