Skip to content

Commit 0859bea

Browse files
committed
Check nix after creating env variables
1 parent ac7c935 commit 0859bea

File tree

3 files changed

+16
-45
lines changed

3 files changed

+16
-45
lines changed

docker/debian/Dockerfile

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -193,22 +193,17 @@ ccache --version
193193
EOF
194194

195195
# Install nix
196-
RUN <<EOF
197-
sh <(curl --proto '=https' --tlsv1.2 -L https://nixos.org/nix/install) --daemon --yes
198-
199-
# Source the nix daemon script to make nix available in the current shell.
200-
. /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh
201-
202-
# Verify the installation.
203-
nix --version
204-
EOF
196+
RUN sh <(curl --proto '=https' --tlsv1.2 -L https://nixos.org/nix/install) --daemon --yes
205197

206198
# Add nix to PATH and set NIX environment variables so nix is available in all
207199
# shells including non-interactive shells (e.g., GitHub Actions).
208200
ENV PATH="/nix/var/nix/profiles/default/bin:${PATH}"
209201
ENV NIX_PROFILES="/nix/var/nix/profiles/default"
210202
ENV NIX_SSL_CERT_FILE="/nix/var/nix/profiles/default/etc/ssl/certs/ca-bundle.crt"
211203

204+
# Verify the nix installation.
205+
RUN nix --version
206+
212207
# Set the Conan home directory, so the users of this image can find the default
213208
# profile.
214209
ENV HOME=/root

docker/rhel/Dockerfile

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -309,22 +309,17 @@ ccache --version
309309
EOF
310310

311311
# Install nix
312-
RUN <<EOF
313-
sh <(curl --proto '=https' --tlsv1.2 -L https://nixos.org/nix/install) --daemon --yes
314-
315-
# Source the nix daemon script to make nix available in the current shell.
316-
. /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh
317-
318-
# Verify the installation.
319-
nix --version
320-
EOF
312+
RUN sh <(curl --proto '=https' --tlsv1.2 -L https://nixos.org/nix/install) --daemon --yes
321313

322314
# Add nix to PATH and set NIX environment variables so nix is available in all
323315
# shells including non-interactive shells (e.g., GitHub Actions).
324316
ENV PATH="/nix/var/nix/profiles/default/bin:${PATH}"
325317
ENV NIX_PROFILES="/nix/var/nix/profiles/default"
326318
ENV NIX_SSL_CERT_FILE="/nix/var/nix/profiles/default/etc/ssl/certs/ca-bundle.crt"
327319

320+
# Verify the nix installation.
321+
RUN nix --version
322+
328323
# Set the Conan home directory, so the users of this image can find the default
329324
# profile.
330325
ENV HOME=/root

docker/ubuntu/Dockerfile

Lines changed: 8 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -166,22 +166,17 @@ ccache --version
166166
EOF
167167

168168
# Install nix
169-
RUN <<EOF
170-
sh <(curl --proto '=https' --tlsv1.2 -L https://nixos.org/nix/install) --daemon --yes
171-
172-
# Source the nix daemon script to make nix available in the current shell.
173-
. /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh
174-
175-
# Verify the installation.
176-
nix --version
177-
EOF
169+
RUN sh <(curl --proto '=https' --tlsv1.2 -L https://nixos.org/nix/install) --daemon --yes
178170

179171
# Add nix to PATH and set NIX environment variables so nix is available in all
180172
# shells including non-interactive shells (e.g., GitHub Actions).
181173
ENV PATH="/nix/var/nix/profiles/default/bin:${PATH}"
182174
ENV NIX_PROFILES="/nix/var/nix/profiles/default"
183175
ENV NIX_SSL_CERT_FILE="/nix/var/nix/profiles/default/etc/ssl/certs/ca-bundle.crt"
184176

177+
# Verify the nix installation.
178+
RUN nix --version
179+
185180
# Set the Conan home directory, so the users of this image can find the default
186181
# profile.
187182
ENV HOME=/root
@@ -299,22 +294,17 @@ ccache --version
299294
EOF
300295

301296
# 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
297+
RUN sh <(curl --proto '=https' --tlsv1.2 -L https://nixos.org/nix/install) --daemon --yes
311298

312299
# Add nix to PATH and set NIX environment variables so nix is available in all
313300
# shells including non-interactive shells (e.g., GitHub Actions).
314301
ENV PATH="/nix/var/nix/profiles/default/bin:${PATH}"
315302
ENV NIX_PROFILES="/nix/var/nix/profiles/default"
316303
ENV NIX_SSL_CERT_FILE="/nix/var/nix/profiles/default/etc/ssl/certs/ca-bundle.crt"
317304

305+
# Verify the nix installation.
306+
RUN nix --version
307+
318308
# Set the Conan home directory, so the users of this image can find the default
319309
# profile.
320310
ENV HOME=/root
@@ -349,12 +339,3 @@ cd test && ./run.sh clang
349339
cd ..
350340
rm -rf test
351341
EOF
352-
353-
354-
355-
356-
357-
358-
359-
360-

0 commit comments

Comments
 (0)