Skip to content

Commit

Permalink
build with rev
Browse files Browse the repository at this point in the history
  • Loading branch information
viperML committed Nov 27, 2024
1 parent fcda03b commit df8fb93
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 4 additions & 0 deletions package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ rustPlatform.buildRustPackage {

cargoLock.lockFile = ./Cargo.lock;

env = {
NH_REV = rev;
};

meta = {
description = "Yet another nix cli helper";
homepage = "https://github.com/viperML/nh";
Expand Down
3 changes: 2 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ use color_eyre::Result;
use tracing::debug;

const NH_VERSION: &str = env!("CARGO_PKG_VERSION");
const NH_REV: Option<&str> = option_env!("NH_REV");

fn main() -> Result<()> {
let mut do_warn = false;
Expand All @@ -28,7 +29,7 @@ fn main() -> Result<()> {
let args = <crate::interface::Main as clap::Parser>::parse();
crate::logging::setup_logging(args.verbose)?;
tracing::debug!("{args:#?}");
tracing::debug!(%NH_VERSION);
tracing::debug!(%NH_VERSION, ?NH_REV);

if do_warn {
tracing::warn!(
Expand Down

0 comments on commit df8fb93

Please sign in to comment.