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.
This commit is contained in:
Charles Hall 2025-03-02 10:54:56 -08:00
parent 57c79b1999
commit e11e27bc0c
No known key found for this signature in database
GPG key ID: 7B8E0645816E07CF

View file

@ -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