Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improve the way sbomnix reads pacakge metadata #62

Closed
henrirosten opened this issue May 10, 2023 · 4 comments
Closed

improve the way sbomnix reads pacakge metadata #62

henrirosten opened this issue May 10, 2023 · 4 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@henrirosten
Copy link
Collaborator

sbomnix reads the nix package meta info from the json file given via the command-line --meta option.

This needs to be re-done properly, ultimately aiming to get rid of the need for --meta command line argument completely.

@henrirosten henrirosten added enhancement New feature or request help wanted Extra attention is needed labels May 10, 2023
@domenkozar
Copy link

How about:

diff --git a/pkgs/stdenv/generic/make-derivation.nix b/pkgs/stdenv/generic/make-derivation.nix
index 51c78c55d599..f4ad35af2c1a 100644
--- a/pkgs/stdenv/generic/make-derivation.nix
+++ b/pkgs/stdenv/generic/make-derivation.nix
@@ -299,6 +299,7 @@ else let
        "__impureHostDeps" "__propagatedImpureHostDeps"
        "sandboxProfile" "propagatedSandboxProfile"]
        ++ lib.optional (__structuredAttrs || envIsExportable) "env"))
+    // { meta =  builtins.toJSON (attrs.meta or {}); }
     // (lib.optionalAttrs (attrs ? name || (attrs ? pname && attrs ? version)) {
       name =
         let

@henrirosten
Copy link
Collaborator Author

henrirosten commented Sep 25, 2023

@domenkozar : thanks for providing input to this issue!

What you are proposing requires a change in nixpkgs, right?

@domenkozar
Copy link

NixOS/nixpkgs#256296

@henrirosten
Copy link
Collaborator Author

Resolved with #100

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants