diff --git a/flake.nix b/flake.nix index e02f611..661497b 100644 --- a/flake.nix +++ b/flake.nix @@ -70,12 +70,7 @@ perSystem = { config, system, pkgs, lib, ... }: let - # Include the Git commit hash as the version of bombon in generated Boms - GIT_COMMIT = lib.optionalString (self ? rev) self.rev; - - transformer = pkgs.callPackage ./nix/packages/transformer.nix { - inherit GIT_COMMIT; - }; + transformer = pkgs.callPackage ./nix/packages/transformer.nix { }; buildBom = pkgs.callPackage ./nix/build-bom.nix { inherit transformer; @@ -138,8 +133,6 @@ inputsFrom = [ transformer ]; RUST_SRC_PATH = "${pkgs.rust.packages.stable.rustPlatform.rustLibSrc}"; - - inherit GIT_COMMIT; }; }; diff --git a/nix/packages/transformer.nix b/nix/packages/transformer.nix index cf25d0d..3e09787 100644 --- a/nix/packages/transformer.nix +++ b/nix/packages/transformer.nix @@ -1,8 +1,6 @@ { lib , rustPlatform , gitignoreSource - -, GIT_COMMIT }: rustPlatform.buildRustPackage { @@ -15,10 +13,6 @@ rustPlatform.buildRustPackage { lockFile = ../../rust/transformer/Cargo.lock; }; - env = { - inherit GIT_COMMIT; - }; - meta = with lib; { homepage = "https://github.com/nikstur/bombon"; license = licenses.mit; diff --git a/rust/transformer/src/cyclonedx.rs b/rust/transformer/src/cyclonedx.rs index b71167a..9191d1e 100644 --- a/rust/transformer/src/cyclonedx.rs +++ b/rust/transformer/src/cyclonedx.rs @@ -11,7 +11,7 @@ use cyclonedx_bom::models::tool::{Tool, Tools}; use crate::buildtime_input::{self, Derivation, Meta}; -const VERSION: &str = env!("GIT_COMMIT"); +const VERSION: &str = env!("CARGO_PKG_VERSION"); pub struct CycloneDXBom(Bom);