This is to announce a few things I’ve been working on and to see where there is interest or overlap.
-
a modification to buldImageWithNixDb that incorporates all the layers (builds up a list from a fromImage passthru attribute) rather than just the deepest.
-
modifications to buildImageWithNixDb that allows nix-build and nix-env without using runAsRoot.
-
use hack from aszlig (How to get the build-time dependencies of a package? · Issue #1245 · NixOS/nix · GitHub) to include runtime deps of all build dependencies for packages needed to nix-build something in CI. Also include relevant nixpkgs to avoid a fetch.
-
post-build-hook to push results to a ./cache. This is to allow gitlab’s cache mechanism to work nicely and be available for subsequent builds. Can we avoid this? The .cache is currently in the form of a binary cache. Can it directly be a build-capable store, bypassing the “nix copy” step?
-
modification to buildLayeredImage with an attribute allowing a custom number of paths used per layer. Eg, “I want the 10 most popular paths in a single layer, and the subsequent paths in their own layer”.
-
a hack (looking for better ideas) for bulldLayeredImage to hint the popularity metric that a particular package should be deeper in the stack. This is probably better expressed as a map or different form of hinting compared to previous item.
-
not yet implemented: expose the intermediate build steps of images so that layers can be re-used/cached. Also can prevent tar/untar cycles. Perhaps use laziness to allow fast building of images directories and uploading to registries without a costly tar.gz. Also trying to avoid a single-threaded trip through nix-daemon of all the data.
-
todo: Update image manifest to schema 2v2.