From e11e27bc0c4cf10f653cdb4610372d236724eef7 Mon Sep 17 00:00:00 2001 From: Charles Hall Date: Sun, 2 Mar 2025 10:54:56 -0800 Subject: [PATCH] don't try to set version extra outside flakes The two attributes being accessed here don't exist when calling though flake-compat, so we need to handle that case by making the environment variable unset if neither attribute exists. --- nix/pkgs/default/default.nix | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/nix/pkgs/default/default.nix b/nix/pkgs/default/default.nix index cb7be038..fc9ef5a7 100644 --- a/nix/pkgs/default/default.nix +++ b/nix/pkgs/default/default.nix @@ -57,9 +57,16 @@ let stdenv; }); - buildPackageEnv = { - GRAPEVINE_VERSION_EXTRA = inputs.self.shortRev or inputs.self.dirtyShortRev; - } // buildDepsOnlyEnv; + buildPackageEnv = + let + GRAPEVINE_VERSION_EXTRA = inputs.self.shortRev + or inputs.self.dirtyShortRev + or null; + in + (lib.optionalAttrs (GRAPEVINE_VERSION_EXTRA != null) { + inherit GRAPEVINE_VERSION_EXTRA; + }) + // buildDepsOnlyEnv; commonAttrs = { # Reading from cargoManifest directly instead of using