Skip to content

Commit

Permalink
Merge pull request #95 from nikstur/various-improvements
Browse files Browse the repository at this point in the history
Various improvements
  • Loading branch information
nikstur authored May 9, 2024
2 parents a8083c9 + d826aef commit 33eae42
Show file tree
Hide file tree
Showing 9 changed files with 191 additions and 198 deletions.
4 changes: 4 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,10 @@
packages = [
pkgs.clippy
pkgs.rustfmt
pkgs.cargo-machete
pkgs.cargo-edit
pkgs.cargo-bloat
pkgs.cargo-deny
];

inputsFrom = [ transformer ];
Expand Down
16 changes: 13 additions & 3 deletions nix/buildtime-dependencies.nix
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,20 @@ let
optionalGetAttrs = names: attrs:
lib.genAttrs (builtins.filter (x: lib.hasAttr x attrs) names) (name: attrs.${name});

# Retrieves only the required fields from a derivation and renames outPath so that
# builtins.toJSON actually emits JSON and not only the nix store path
# Retrieve only the required fields from a derivation.
#
# Also renames outPath so that builtins.toJSON actually emits JSON and not
# only the nix store path.
fields = drv:
(optionalGetAttrs [ "name" "pname" "version" "meta" ] drv) // { path = drv.outPath; };
(optionalGetAttrs [ "name" "pname" "version" "meta" ] drv) // {
path = drv.outPath;
} // lib.optionalAttrs (drv ? src && drv.src ? url) {
src = {
inherit (drv.src) url;
} // lib.optionalAttrs (drv.src ? outputHash) {
hash = drv.src.outputHash;
};
};

in

Expand Down
185 changes: 22 additions & 163 deletions rust/transformer/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 10 additions & 11 deletions rust/transformer/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
[package]
name = "bombon-transformer"
version = "0.1.0"
version = "0.2.0"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
anyhow = "1.0"
clap = { version = "4.5", features = ["derive"] }
cyclonedx-bom = "0.5"
itertools = "0.12"
serde = { version = "1.0", features = [ "derive" ] }
serde_json = "1.0"
sha2 = "0.10"
uuid = "1.8"
anyhow = "1.0.83"
clap = { version = "4.5.4", default-features = false, features = ["std", "derive"] }
cyclonedx-bom = "0.5.0"
itertools = "0.12.1"
serde = { version = "1.0.201", features = [ "derive" ] }
serde_json = "1.0.117"
sha2 = "0.10.8"
uuid = "1.8.0"
base64 = "0.21.7"

[lints.rust]
unsafe_code = "forbid"
Expand Down
Loading

0 comments on commit 33eae42

Please sign in to comment.