streamLayeredImage: pass through passthru attributes

This is useful for a use-case we have with a Nix-based CI system that
specifies things like deploy steps as passthru attributes[0].

Previously the only way to do this would have been to concatenate
attributes onto the resulting derivation, but passing them in and
actually treating them as proper passthru attributes is cleaner.

[0]: https://cs.tvl.fyi/depot@f7d7da6aceb407b719cf4683a75878fd3aca319e/-/blob/nix/buildkite/default.nix?L222-226
This commit is contained in:
Vincent Ambo 2022-01-31 10:10:10 +03:00
parent 3fc5756786
commit af9f248926

View file

@ -827,6 +827,8 @@ rec {
# this on, but tooling may disable this to insert the store paths more
# efficiently via other means, such as bind mounting the host store.
includeStorePaths ? true
, # Passthru arguments for the underlying derivation.
passthru ? {}
,
}:
assert
@ -987,7 +989,7 @@ rec {
result = runCommand "stream-${baseName}"
{
inherit (conf) imageName;
passthru = {
passthru = passthru // {
inherit (conf) imageTag;
# Distinguish tarballs and exes at the Nix level so functions that