Skip to content

Commit 2c2a305

Browse files
committed
Add nix to pre-commit image
1 parent bfc265c commit 2c2a305

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

docker/tools-rippled/Dockerfile

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ pkgs+=(python3-venv) # Python environment management tool.
3535
pkgs+=(python3-pip) # Package manager for Python applications.
3636
pkgs+=(wget) # Required build tool.
3737
pkgs+=(vim) # Text editor.
38+
pkgs+=(xz-utils) # Required to install nix
3839
apt-get update
3940
apt-get install -y --no-install-recommends "${pkgs[@]}"
4041
apt-get clean
@@ -54,6 +55,18 @@ FROM base AS pre-commit
5455
# This is not inherited from base image.
5556
ARG DEBIAN_FRONTEND=noninteractive
5657

58+
# Install nix
59+
RUN sh <(curl --proto '=https' --tlsv1.2 -L https://nixos.org/nix/install) --daemon --yes
60+
61+
# Add nix to PATH and set NIX environment variables so nix is available in all
62+
# shells including non-interactive shells (e.g., GitHub Actions).
63+
ENV PATH="/nix/var/nix/profiles/default/bin:${PATH}"
64+
ENV NIX_PROFILES="/nix/var/nix/profiles/default"
65+
ENV NIX_SSL_CERT_FILE="/nix/var/nix/profiles/default/etc/ssl/certs/ca-bundle.crt"
66+
67+
# Verify nix installation
68+
RUN nix --version
69+
5770
# Install additional dependencies.
5871
RUN <<EOF
5972
apt-get update

0 commit comments

Comments
 (0)