From f5c31ce0088c04a301f285ecf20dc0e97f72a3a5 Mon Sep 17 00:00:00 2001 From: Eman Resu <78693624+quatquatt@users.noreply.github.com> Date: Tue, 26 May 2026 14:22:32 -0400 Subject: [PATCH] build-support/docker: remove throwIf usage --- pkgs/build-support/docker/default.nix | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/pkgs/build-support/docker/default.nix b/pkgs/build-support/docker/default.nix index 4057ec98627a..d8e9812c7bec 100644 --- a/pkgs/build-support/docker/default.nix +++ b/pkgs/build-support/docker/default.nix @@ -655,9 +655,12 @@ rec { checked = lib.warnIf (contents != null) "in docker image ${name}: The contents parameter is deprecated. Change to copyToRoot if the contents are designed to be copied to the root filesystem, such as when you use `buildEnv` or similar between contents and your packages. Use copyToRoot = buildEnv { ... }; or similar if you intend to add packages to /bin." - lib.throwIf - (contents != null && copyToRoot != null) - "in docker image ${name}: You can not specify both contents and copyToRoot."; + ( + if (contents != null && copyToRoot != null) then + throw "in docker image ${name}: You can not specify both contents and copyToRoot." + else + x: x + ); rootContents = if copyToRoot == null then contents else copyToRoot;