From afce61251d28899e33ffaabdabedbbd5bd3b9bcd Mon Sep 17 00:00:00 2001 From: Niklas Korz Date: Thu, 5 Sep 2024 12:20:33 +0200 Subject: [PATCH] zed-editor: fix `--version` --- pkgs/by-name/ze/zed-editor/package.nix | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/pkgs/by-name/ze/zed-editor/package.nix b/pkgs/by-name/ze/zed-editor/package.nix index a33567fa5b76..f999227661c8 100644 --- a/pkgs/by-name/ze/zed-editor/package.nix +++ b/pkgs/by-name/ze/zed-editor/package.nix @@ -28,6 +28,8 @@ envsubst, nix-update-script, cargo-about, + testers, + zed-editor, withGLES ? false, }: @@ -136,6 +138,8 @@ rustPlatform.buildRustPackage rec { # Setting this environment variable allows to disable auto-updates # https://zed.dev/docs/development/linux#notes-for-packaging-zed ZED_UPDATE_EXPLANATION = "zed has been installed using nix. Auto-updates have thus been disabled."; + # Used by `zed --version` + RELEASE_VERSION = version; }; RUSTFLAGS = if withGLES then "--cfg gles" else ""; @@ -187,11 +191,17 @@ rustPlatform.buildRustPackage rec { runHook postInstall ''; - passthru.updateScript = nix-update-script { - extraArgs = [ - "--version-regex" - "v(.*)" - ]; + passthru = { + updateScript = nix-update-script { + extraArgs = [ + "--version-regex" + "v(.*)" + ]; + }; + tests.version = testers.testVersion { + inherit version; + package = zed-editor; + }; }; meta = {