@@ -176,6 +176,12 @@ sh <(curl --proto '=https' --tlsv1.2 -L https://nixos.org/nix/install) --daemon
176176nix --version
177177EOF
178178
179+ # Add nix to PATH and set NIX environment variables so nix is available in all
180+ # shells including non-interactive shells (e.g., GitHub Actions).
181+ ENV PATH="/nix/var/nix/profiles/default/bin:${PATH}"
182+ ENV NIX_PROFILES="/nix/var/nix/profiles/default"
183+ ENV NIX_SSL_CERT_FILE="/nix/var/nix/profiles/default/etc/ssl/certs/ca-bundle.crt"
184+
179185# Set the Conan home directory, so the users of this image can find the default
180186# profile.
181187ENV HOME=/root
@@ -221,8 +227,15 @@ ARG UBUNTU_VERSION
221227# Install Clang. Some build dependencies require GCC to be also available.
222228ARG CLANG_VERSION
223229RUN <<EOF
230+ # As of 2026-02-01, newer distros reject GPG keys using SHA1 signatures as insecure.
231+ # Some LLVM/Clang repository GPG keys may still use SHA1. We configure apt to allow
232+ # weak signatures and use --allow-unauthenticated as a workaround for trusted repositories.
233+ printf "%s\n " \
234+ "Acquire::AllowInsecureRepositories \" true\" ;" \
235+ "Acquire::AllowWeakRepositories \" true\" ;" \
236+ | tee /etc/apt/apt.conf.d/99allow-weak
224237apt-get update
225- apt-get install -y --no-install-recommends \
238+ apt-get install -y --no-install-recommends --allow-unauthenticated \
226239 clang-${CLANG_VERSION} \
227240 libclang-rt-${CLANG_VERSION}-dev \
228241 llvm-${CLANG_VERSION} \
@@ -285,6 +298,23 @@ rm -rf ccache-${CCACHE_VERSION}
285298ccache --version
286299EOF
287300
301+ # Install nix
302+ RUN <<EOF
303+ sh <(curl --proto '=https' --tlsv1.2 -L https://nixos.org/nix/install) --daemon --yes
304+
305+ # Source the nix daemon script to make nix available in the current shell.
306+ . /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh
307+
308+ # Verify the installation.
309+ nix --version
310+ EOF
311+
312+ # Add nix to PATH and set NIX environment variables so nix is available in all
313+ # shells including non-interactive shells (e.g., GitHub Actions).
314+ ENV PATH="/nix/var/nix/profiles/default/bin:${PATH}"
315+ ENV NIX_PROFILES="/nix/var/nix/profiles/default"
316+ ENV NIX_SSL_CERT_FILE="/nix/var/nix/profiles/default/etc/ssl/certs/ca-bundle.crt"
317+
288318# Set the Conan home directory, so the users of this image can find the default
289319# profile.
290320ENV HOME=/root
@@ -320,3 +350,11 @@ cd ..
320350rm -rf test
321351EOF
322352
353+
354+
355+
356+
357+
358+
359+
360+
0 commit comments