Skip to content

Commit

Permalink
Merge pull request #482 from cachix/fix/devcontainer
Browse files Browse the repository at this point in the history
fix devcontainer
  • Loading branch information
domenkozar authored Mar 13, 2023
2 parents 8a46d83 + 0317938 commit 2ef261d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
9 changes: 8 additions & 1 deletion devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ RUN wget -O install.sh https://nixos.org/nix/install \

ENV \
ENV=/etc/profile \
USER=root \
USER=vscode \
PATH=/nix/var/nix/profiles/default/bin:/nix/var/nix/profiles/default/sbin:/bin:/sbin:/usr/bin:/usr/sbin \
GIT_SSL_CAINFO=/etc/ssl/certs/ca-certificates.crt \
NIX_SSL_CERT_FILE=/etc/ssl/certs/ca-certificates.crt
Expand All @@ -31,4 +31,11 @@ RUN /nix-entrypoint.sh sleep 5 \
&& sudo /nix/var/nix/profiles/default/bin/nix-collect-garbage --delete-old \
&& chown -R root:nixbld /nix

RUN mkdir -p /home/vscode/.config/direnv \
&& echo '[whitelist]' > /home/vscode/.config/direnv/config.toml \
&& echo 'prefix = [ "/workspaces" ]' >> /home/vscode/.config/direnv/config.toml \
&& direnv hook bash >> /home/vscode/.bashrc \
&& chown -R vscode:vscode /home/vscode/.config \
&& chown -R vscode:vscode /home/vscode/.bashrc

ENTRYPOINT ["/nix-entrypoint.sh", "sleep", "infinity"]
1 change: 1 addition & 0 deletions devcontainer/nix-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,5 @@ if ! pidof nix-daemon > /dev/null 2>&1; then
echo -e 'Failed to start nix-daemon as root. Set multiUser to false in your feature configuraiton if you would\nprefer to run the container as a non-root. You may also start the daemon manually if you have sudo\ninstalled and configured for your user by running "sudo -c nix-daemon &"'
fi
fi
sudo setfacl --remove-default /tmp
exec "$@"

0 comments on commit 2ef261d

Please sign in to comment.