Skip to content

Commit

Permalink
build: Generate Sbom for tools via nix
Browse files Browse the repository at this point in the history
Using [`bombon`](https://github.com/nikstur/bombon) we can automatically generate a CycloneDX SBOM from the nix packages used for our tooling.

Signed-off-by: Felix Hilgers <[email protected]>
  • Loading branch information
fhilgers authored and Mr-Kanister committed Oct 29, 2024
1 parent fb85008 commit 64250d5
Show file tree
Hide file tree
Showing 3 changed files with 152 additions and 4 deletions.
142 changes: 140 additions & 2 deletions flake.lock

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

13 changes: 11 additions & 2 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,13 @@
url = "github:nlewo/nix2container";
inputs.nixpkgs.follows = "nixpkgs";
};
bombon = {
url = "github:nikstur/bombon";
inputs.nixpkgs.follows = "nixpkgs";
};
};

outputs = inputs@{ self, nixpkgs, fenix, android-nixpkgs, nix2container, flake-parts, ... }:
outputs = inputs@{ self, nixpkgs, fenix, android-nixpkgs, nix2container, bombon, flake-parts, ... }:
flake-parts.lib.mkFlake { inherit inputs; } {
imports = [
./nix/overlay-module.nix
Expand Down Expand Up @@ -157,14 +161,19 @@
};
};

toolsDevShell = pkgs.mkShell {
packages = packageGroups.combined;
};

in
{
devShells = {
default = pkgs.mkShell { packages = packageGroups.combined; };
default = toolsDevShell;
};
packages = {
dockerBuilderBase = builderBase;
dockerBuilder = builder;
toolsSbom = pkgs.buildBom toolsDevShell { };
};
};
};
Expand Down
1 change: 1 addition & 0 deletions nix/overlay-module.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
self.inputs.android-nixpkgs.overlays.default
(prev: super: { n2c = inputs.nix2container.packages.${system}.nix2container; })
(prev: super: { bashConfigs = import ./bash-configs.nix { pkgs = prev; }; })
(prev: super: { buildBom = inputs.bombon.lib.${system}.buildBom; })
];
};
};
Expand Down

0 comments on commit 64250d5

Please sign in to comment.