Skip to content

Commit 3ea69d3

Browse files
committed
feature: docker: io: nix
1 parent e53aa06 commit 3ea69d3

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

docker/Dockerfile.io

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,26 @@ COPY package.json /usr/src/cloudcmd/
99

1010
ENV DEBIAN_FRONTEND=noninteractive
1111
ENV PATH=/usr/local/src/cargo/bin:$PATH
12+
ENV NIX_CONFIG="sandbox = false filter-syscalls = false"
1213

1314
ARG GO_VERSION=1.21.2
1415

15-
RUN apt-get update && apt-get upgrade && apt-get autoremove && \
16+
RUN apt-get update && apt-get upgrade -y && apt-get autoremove && \
1617
apt-get install -y less ffmpeg net-tools netcat-openbsd mc iputils-ping vim neovim bat fzf \
1718
locales sudo command-not-found && \
1819
echo "> Update command-not-found database. Run 'sudo apt update' to populate it." && \
1920
apt-get update && \
2021
apt-get autoremove && apt-get clean && \
2122
rm -rf /var/lib/apt/lists/* && \
23+
echo "> install nix" && \
24+
useradd -m -s /bin/bash nixuser && \
25+
echo "nixuser ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/nixuser && \
26+
chmod 0440 /etc/sudoers.d/nixuser && \
27+
su - nixuser -c "curl -L https://nixos.org/nix/install | sh -s -- --no-daemon" && \
28+
mv /home/nixuser/.nix-profile /usr/local/src/nix-profile && \
29+
mv /home/nixuser/.nix-defexpr /usr/local/src/nix-defexpr && \
30+
rm -rf /etc/sudoers.d/nixuser && \
31+
userdel -r nixuser && \
2232
echo "> install nvm" && \
2333
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.4/install.sh | bash && \
2434
mv ~/.nvm /usr/local/src/nvm && \
@@ -79,6 +89,8 @@ ENV cloudcmd_terminal_path=gritty
7989
ENV cloudcmd_open=false
8090
8191
ENV PATH=node_modules/.bin:$PATH
92+
ENV PATH=/usr/local/src/nix/profile/bin:$PATH
93+
ENV NIX_PATH=/usr/local/src/nix/defexpr/channels
8294
8395
ENV BUN_INSTALL_CACHE_DIR=/tmp/bun-cache
8496
ENV DENO_DIR=/tmp/deno-cache

0 commit comments

Comments
 (0)