From 5819aa9e67a7892192880b300e9edd8d6198baad Mon Sep 17 00:00:00 2001 From: Matej Cotman Date: Tue, 27 Jun 2023 06:36:54 +0300 Subject: [PATCH 1/2] lemmy-ui: write version to correct file --- pkgs/servers/web-apps/lemmy/ui.nix | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/pkgs/servers/web-apps/lemmy/ui.nix b/pkgs/servers/web-apps/lemmy/ui.nix index 65076eaa89e40..3377b54c861f4 100644 --- a/pkgs/servers/web-apps/lemmy/ui.nix +++ b/pkgs/servers/web-apps/lemmy/ui.nix @@ -64,6 +64,7 @@ mkYarnPackage { export HOME=$PWD/yarn_home ln -sf $PWD/node_modules $PWD/deps/lemmy-ui/ + echo 'export const VERSION = "${version}";' > $PWD/deps/lemmy-ui/src/shared/version.ts yarn --offline build:prod ''; @@ -74,10 +75,6 @@ mkYarnPackage { cp -R ./node_modules $out ''; - postInstall = '' - echo 'export const VERSION = "${version}";' > $out/libexec/lemmy-ui/deps/lemmy-ui/src/shared/version.ts - ''; - distPhase = "true"; passthru.updateScript = ./update.sh; From 31fcf2b3195472555b7273de429c66fa65c25e29 Mon Sep 17 00:00:00 2001 From: Matej Cotman Date: Tue, 27 Jun 2023 06:56:51 +0300 Subject: [PATCH 2/2] lemmy-server: write version to file --- pkgs/servers/web-apps/lemmy/server.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkgs/servers/web-apps/lemmy/server.nix b/pkgs/servers/web-apps/lemmy/server.nix index c5c9924779e14..d37e18224a778 100644 --- a/pkgs/servers/web-apps/lemmy/server.nix +++ b/pkgs/servers/web-apps/lemmy/server.nix @@ -31,6 +31,10 @@ rustPlatform.buildRustPackage rec { ./tokio-macros.patch ]; + preConfigure = '' + echo 'pub const VERSION: &str = "${version}";' > crates/utils/src/version.rs + ''; + cargoSha256 = pinData.serverCargoSha256; buildInputs = [ postgresql ]