Reusable Nix utilities (scripts and small packages) shared across d3strukt0r projects.
| Output | Purpose |
|---|---|
packages.<system>.fixOciImageHistory |
stdin/stdout post-processor for nixpkgs dockerTools.streamLayeredImage tarballs. Copies history[].comment → history[].created_by so dive / Docker Desktop show readable per-layer commands, appends a synthetic HEALTHCHECK history entry (Trivy DS-0026 workaround), recomputes the config-blob digest, rewrites manifest.json. |
| Function | Purpose |
|---|---|
lib.oci.secondsToNanos n |
Convert seconds → nanoseconds. OCI image spec stores Healthcheck Interval/Timeout/StartPeriod in nanoseconds. |
lib.oci.createdFromDate d |
Convert a Nix-flake YYYYMMDDHHMMSS date string (e.g. self.lastModifiedDate) to RFC3339 for the OCI image created field. |
Add as a flake input, share nixpkgs to keep the lock file clean:
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.11";
nix-utils.url = "github:d3strukt0r/nix-utils";
nix-utils.inputs.nixpkgs.follows = "nixpkgs";
};
outputs = { self, nixpkgs, nix-utils }:
let
pkgs = import nixpkgs { system = "x86_64-linux"; };
stream = pkgs.dockerTools.streamLayeredImage { /* ... */ };
in {
packages.x86_64-linux.image = pkgs.runCommand "image.tar" { } ''
${stream} | ${nix-utils.packages.x86_64-linux.fixOciImageHistory} > $out
'';
};
}Supported systems: x86_64-linux, aarch64-linux, riscv64-linux.
Please read CONTRIBUTING.md for details on our code of conduct and the process for submitting pull requests.
This project uses Conventional Commits.
We use SemVer for versioning. For available versions, see the tags on this repository.
- Manuele - D3strukt0r
See also the full list of contributors who participated in this project.
We're currently looking for contributions for the following:
- Bug fixes
- etc...
For more information, please refer to our CONTRIBUTING.md guide.
This project is licensed under the MIT License - see the LICENSE.txt file for details.
This project currently uses no third-party libraries or copied code.