From af9f248926b5d641186d64861b5e5c9fa784f18c Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Mon, 31 Jan 2022 10:10:10 +0300 Subject: [PATCH] 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 --- pkgs/build-support/docker/default.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkgs/build-support/docker/default.nix b/pkgs/build-support/docker/default.nix index 1b6c340f7f0c..5718cadd4ffa 100644 --- a/pkgs/build-support/docker/default.nix +++ b/pkgs/build-support/docker/default.nix @@ -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