Nix profile install errors, wants --impure

I’ve got a Dockerfile that installs devenv. Up until now there’s been no issue using nix profile install --accept-flake-config github:cachix/devenv, but now that I’m updating to nixos/nix:2.20.1 it no longer works. I’m not seeing anything in Github issues nor the release notes that stands out to me. Any clue whats going on?

Here’s what I’m seeing

Good: Dockerfile.2.19.3

FROM nixos/nix:2.19.3@sha256:498fa2d7f2b5cb3891a4edf20f3a8f8496e70865099ba72540494cd3e2942634

ENTRYPOINT ["devenv", "shell"]
ENV LANG=en_US.UTF-8 
WORKDIR /root/

RUN git config --global --add safe.directory '*' && \
    mkdir -p .config/nix/ && \
    echo 'experimental-features = nix-command flakes' | tee .config/nix/nix.conf
RUN nix profile install --accept-flake-config github:cachix/devenv
docker build --progress plain -f Dockerfile.2.19.3 .
#0 building with "default" instance using docker driver

#1 [internal] load .dockerignore
#1 transferring context: 2B done
#1 DONE 0.0s

#2 [internal] load build definition from Dockerfile.2.19.3
#2 transferring dockerfile: 443B done
#2 DONE 0.0s

#3 [internal] load metadata for docker.io/nixos/nix:2.19.3@sha256:498fa2d7f2b5cb3891a4edf20f3a8f8496e70865099ba72540494cd3e2942634
#3 DONE 0.0s

#4 [1/4] FROM docker.io/nixos/nix:2.19.3@sha256:498fa2d7f2b5cb3891a4edf20f3a8f8496e70865099ba72540494cd3e2942634
#4 DONE 0.0s

#5 [2/4] WORKDIR /root/
#5 CACHED

#6 [3/4] RUN git config --global --add safe.directory '*' &&     mkdir -p .config/nix/ &&     echo 'experimental-features = nix-command flakes' | tee .config/nix/nix.conf
#6 CACHED

#7 [4/4] RUN nix profile install --accept-flake-config github:cachix/devenv
#7 CACHED

#8 exporting to image
#8 exporting layers done
#8 writing image sha256:a02cc6ce53c3ff426f57480d811c38228556fc5064f950bc7b9d26d17898b5de done
#8 DONE 0.0s

Bad: Dockerfile.2.20.1

FROM nixos/nix:2.20.1@sha256:ab7306ccfa8168ad63f4e91a6217a73decdd641c49c7274212a93df19ee88938

ENTRYPOINT ["devenv", "shell"]
ENV LANG=en_US.UTF-8 
WORKDIR /root/

RUN git config --global --add safe.directory '*' && \
    mkdir -p .config/nix/ && \
    echo 'experimental-features = nix-command flakes' | tee .config/nix/nix.conf

RUN nix profile install --accept-flake-config github:cachix/devenv
docker build --progress plain -f Dockerfile.2.20.1 .
docker build --progress plain -f Dockerfile.2.20.1 .
#0 building with "default" instance using docker driver

#1 [internal] load .dockerignore
#1 transferring context: 2B done
#1 DONE 0.0s

#2 [internal] load build definition from Dockerfile.2.20.1
#2 transferring dockerfile: 444B done
#2 DONE 0.0s

#3 [internal] load metadata for docker.io/nixos/nix:2.20.1@sha256:ab7306ccfa8168ad63f4e91a6217a73decdd641c49c7274212a93df19ee88938
#3 DONE 0.0s

#4 [1/4] FROM docker.io/nixos/nix:2.20.1@sha256:ab7306ccfa8168ad63f4e91a6217a73decdd641c49c7274212a93df19ee88938
#4 DONE 0.0s

#5 [2/4] WORKDIR /root/
#5 CACHED

#6 [3/4] RUN git config --global --add safe.directory '*' &&     mkdir -p .config/nix/ &&     echo 'experimental-features = nix-command flakes' | tee .config/nix/nix.conf
#6 CACHED

#7 [4/4] RUN nix profile install --accept-flake-config github:cachix/devenv
#7 0.192 error: access to absolute path '/nix/store/qr87qj2rspf7n1vcibqwh9ghc5in74vc-user-environment' is forbidden in pure evaluation mode (use '--impure' to override)
#7 ERROR: process "/bin/sh -c nix profile install --accept-flake-config github:cachix/devenv" did not complete successfully: exit code: 1
------
 > [4/4] RUN nix profile install --accept-flake-config github:cachix/devenv:
0.192 error: access to absolute path '/nix/store/qr87qj2rspf7n1vcibqwh9ghc5in74vc-user-environment' is forbidden in pure evaluation mode (use '--impure' to override)
------
Dockerfile.2.20.1:11
--------------------
   9 |         echo 'experimental-features = nix-command flakes' | tee .config/nix/nix.conf
  10 |     
  11 | >>> RUN nix profile install --accept-flake-config github:cachix/devenv
  12 |     
--------------------
ERROR: failed to solve: process "/bin/sh -c nix profile install --accept-flake-config github:cachix/devenv" did not complete successfully: exit code: 1