Skip to content

Commit 5aa0bf3

Browse files
committed
Move nix installation
1 parent 57f45df commit 5aa0bf3

File tree

3 files changed

+30
-36
lines changed

3 files changed

+30
-36
lines changed

docker/debian/Dockerfile

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,15 @@ ENV RUSTUP_HOME="/opt/rust/.rustup"
9797
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain=${RUST_VERSION}
9898
ENV PATH="$CARGO_HOME/bin:$PATH"
9999

100+
# Install nix
101+
RUN sh <(curl --proto '=https' --tlsv1.2 -L https://nixos.org/nix/install) --daemon --yes
102+
103+
# Add nix to PATH and set NIX environment variables so nix is available in all
104+
# shells including non-interactive shells (e.g., GitHub Actions).
105+
ENV PATH="/nix/var/nix/profiles/default/bin:${PATH}"
106+
ENV NIX_PROFILES="/nix/var/nix/profiles/default"
107+
ENV NIX_SSL_CERT_FILE="/nix/var/nix/profiles/default/etc/ssl/certs/ca-bundle.crt"
108+
100109
# Print versions.
101110
RUN <<EOF
102111
cmake --version
@@ -107,6 +116,7 @@ mold --version
107116
python3 --version
108117
rustc --version
109118
cargo --version
119+
nix --version
110120
EOF
111121

112122
# ====================== GCC IMAGE ======================
@@ -192,18 +202,6 @@ rm -rf ccache-${CCACHE_VERSION}
192202
ccache --version
193203
EOF
194204

195-
# Install nix
196-
RUN sh <(curl --proto '=https' --tlsv1.2 -L https://nixos.org/nix/install) --daemon --yes
197-
198-
# Add nix to PATH and set NIX environment variables so nix is available in all
199-
# shells including non-interactive shells (e.g., GitHub Actions).
200-
ENV PATH="/nix/var/nix/profiles/default/bin:${PATH}"
201-
ENV NIX_PROFILES="/nix/var/nix/profiles/default"
202-
ENV NIX_SSL_CERT_FILE="/nix/var/nix/profiles/default/etc/ssl/certs/ca-bundle.crt"
203-
204-
# Verify the nix installation.
205-
RUN nix --version
206-
207205
# Set the Conan home directory, so the users of this image can find the default
208206
# profile.
209207
ENV HOME=/root

docker/rhel/Dockerfile

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,15 @@ ENV RUSTUP_HOME="/opt/rust/.rustup"
109109
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain=${RUST_VERSION}
110110
ENV PATH="$CARGO_HOME/bin:$PATH"
111111

112+
# Install nix
113+
RUN sh <(curl --proto '=https' --tlsv1.2 -L https://nixos.org/nix/install) --daemon --yes
114+
115+
# Add nix to PATH and set NIX environment variables so nix is available in all
116+
# shells including non-interactive shells (e.g., GitHub Actions).
117+
ENV PATH="/nix/var/nix/profiles/default/bin:${PATH}"
118+
ENV NIX_PROFILES="/nix/var/nix/profiles/default"
119+
ENV NIX_SSL_CERT_FILE="/nix/var/nix/profiles/default/etc/ssl/certs/ca-bundle.crt"
120+
112121
# Print versions.
113122
RUN <<EOF
114123
cmake --version
@@ -119,6 +128,7 @@ mold --version
119128
python3 --version
120129
rustc --version
121130
cargo --version
131+
nix --version
122132
EOF
123133

124134
# ====================== GCC IMAGE ======================
@@ -308,18 +318,6 @@ rm -rf ccache-${CCACHE_VERSION}
308318
ccache --version
309319
EOF
310320

311-
# Install nix
312-
RUN sh <(curl --proto '=https' --tlsv1.2 -L https://nixos.org/nix/install) --daemon --yes
313-
314-
# Add nix to PATH and set NIX environment variables so nix is available in all
315-
# shells including non-interactive shells (e.g., GitHub Actions).
316-
ENV PATH="/nix/var/nix/profiles/default/bin:${PATH}"
317-
ENV NIX_PROFILES="/nix/var/nix/profiles/default"
318-
ENV NIX_SSL_CERT_FILE="/nix/var/nix/profiles/default/etc/ssl/certs/ca-bundle.crt"
319-
320-
# Verify the nix installation.
321-
RUN nix --version
322-
323321
# Set the Conan home directory, so the users of this image can find the default
324322
# profile.
325323
ENV HOME=/root

docker/ubuntu/Dockerfile

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,15 @@ ENV RUSTUP_HOME="/opt/rust/.rustup"
8080
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain=${RUST_VERSION}
8181
ENV PATH="$CARGO_HOME/bin:$PATH"
8282

83+
# Install nix
84+
RUN sh <(curl --proto '=https' --tlsv1.2 -L https://nixos.org/nix/install) --daemon --yes
85+
86+
# Add nix to PATH and set NIX environment variables so nix is available in all
87+
# shells including non-interactive shells (e.g., GitHub Actions).
88+
ENV PATH="/nix/var/nix/profiles/default/bin:${PATH}"
89+
ENV NIX_PROFILES="/nix/var/nix/profiles/default"
90+
ENV NIX_SSL_CERT_FILE="/nix/var/nix/profiles/default/etc/ssl/certs/ca-bundle.crt"
91+
8392
# Print versions.
8493
RUN <<EOF
8594
cmake --version
@@ -90,6 +99,7 @@ mold --version
9099
python3 --version
91100
rustc --version
92101
cargo --version
102+
nix --version
93103
EOF
94104

95105
# ====================== GCC IMAGE ======================
@@ -165,18 +175,6 @@ rm -rf ccache-${CCACHE_VERSION}
165175
ccache --version
166176
EOF
167177

168-
# Install nix
169-
RUN sh <(curl --proto '=https' --tlsv1.2 -L https://nixos.org/nix/install) --daemon --yes
170-
171-
# Add nix to PATH and set NIX environment variables so nix is available in all
172-
# shells including non-interactive shells (e.g., GitHub Actions).
173-
ENV PATH="/nix/var/nix/profiles/default/bin:${PATH}"
174-
ENV NIX_PROFILES="/nix/var/nix/profiles/default"
175-
ENV NIX_SSL_CERT_FILE="/nix/var/nix/profiles/default/etc/ssl/certs/ca-bundle.crt"
176-
177-
# Verify the nix installation.
178-
RUN nix --version
179-
180178
# Set the Conan home directory, so the users of this image can find the default
181179
# profile.
182180
ENV HOME=/root

0 commit comments

Comments
 (0)