You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to convert a Rust project into a flake, that uses the vergen crate to create version metadata from the git repository at build time. I use the git ref and git describe output. vergen is somehow aware of nix and will return VERGEN_IDEMPOTENT_OUTPUT if .git is not present and the metadata cannot be obtained (e.g. in a nix build).
To fully convert the project into a flake, I'd like to set both ${self.rev or self.dirtyRev or "dirty"} and ${self.version} as environment in the nix build and fallback on something like env!("NIX_FLAKE_REF") if vergen cannot calculate metadata from the git repo.
How can I set custom environment variables, that are available when building the project (and possibly also in devShells) when using the template flake?
The text was updated successfully, but these errors were encountered:
I want to convert a Rust project into a flake, that uses the
vergen
crate to create version metadata from the git repository at build time. I use the git ref and git describe output.vergen
is somehow aware of nix and will returnVERGEN_IDEMPOTENT_OUTPUT
if.git
is not present and the metadata cannot be obtained (e.g. in a nix build).To fully convert the project into a flake, I'd like to set both
${self.rev or self.dirtyRev or "dirty"}
and${self.version}
as environment in the nix build and fallback on something likeenv!("NIX_FLAKE_REF")
if vergen cannot calculate metadata from the git repo.How can I set custom environment variables, that are available when building the project (and possibly also in devShells) when using the template flake?
The text was updated successfully, but these errors were encountered: