Skip to content

Commit

Permalink
Make git revision available for nix flake builds (#12331)
Browse files Browse the repository at this point in the history
  • Loading branch information
0rphee authored Dec 25, 2024
1 parent c262fe4 commit 7b9b932
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,8 @@
cp contrib/helix.png $out/share/icons/hicolor/256x256/apps
installShellCompletion contrib/completion/hx.{bash,fish,zsh}
'';
# set git revision for nix flake builds, see 'git_hash' in helix-loader/build.rs
HELIX_NIX_BUILD_REV = self.rev or self.dirtyRev or null;
});
helix = makeOverridableHelix self.packages.${system}.helix-unwrapped {};
default = self.packages.${system}.helix;
Expand Down
3 changes: 2 additions & 1 deletion helix-loader/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ fn main() {
.output()
.ok()
.filter(|output| output.status.success())
.and_then(|x| String::from_utf8(x.stdout).ok());
.and_then(|x| String::from_utf8(x.stdout).ok())
.or_else(|| option_env!("HELIX_NIX_BUILD_REV").map(|s| s.to_string()));

let calver = get_calver();
let version: Cow<_> = match &git_hash {
Expand Down

0 comments on commit 7b9b932

Please sign in to comment.