Skip to content

Commit

Permalink
transformer: use package version instead of commit ID
Browse files Browse the repository at this point in the history
  • Loading branch information
nikstur committed Feb 29, 2024
1 parent 806823f commit 2efb492
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 15 deletions.
9 changes: 1 addition & 8 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -138,8 +133,6 @@
inputsFrom = [ transformer ];

RUST_SRC_PATH = "${pkgs.rust.packages.stable.rustPlatform.rustLibSrc}";

inherit GIT_COMMIT;
};

};
Expand Down
6 changes: 0 additions & 6 deletions nix/packages/transformer.nix
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
{ lib
, rustPlatform
, gitignoreSource

, GIT_COMMIT
}:

rustPlatform.buildRustPackage {
Expand All @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion rust/transformer/src/cyclonedx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 2efb492

Please sign in to comment.