Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 10 additions & 14 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@ FROM mcr.microsoft.com/devcontainers/base:ubuntu

# Install Nix
RUN apt-get update && apt-get install -y \
curl \
xz-utils \
sudo \
&& rm -rf /var/lib/apt/lists/*
curl \
xz-utils \
sudo \
&& rm -rf /var/lib/apt/lists/*

# Create vscode user if it doesn't exist
RUN if ! id -u vscode > /dev/null 2>&1; then \
useradd -m -s /bin/bash vscode && \
echo "vscode ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers; \
fi
useradd -m -s /bin/bash vscode && \
echo "vscode ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers; \
fi

# Switch to vscode user for Nix installation
USER vscode
Expand All @@ -22,12 +22,8 @@ RUN curl -L https://nixos.org/nix/install | sh -s -- --no-daemon

# Add Nix to PATH and configure for the shell
RUN echo '. /home/vscode/.nix-profile/etc/profile.d/nix.sh' >> /home/vscode/.bashrc && \
mkdir -p /home/vscode/.config/nix && \
echo 'experimental-features = nix-command flakes' >> /home/vscode/.config/nix/nix.conf

# Set up workspace directory
RUN sudo mkdir -p /workspace && sudo chown vscode:vscode /workspace
WORKDIR /workspace
mkdir -p /home/vscode/.config/nix && \
echo 'experimental-features = nix-command flakes' >> /home/vscode/.config/nix/nix.conf

# Keep container running
CMD ["sleep", "infinity"]
CMD ["sleep", "infinity"]
6 changes: 1 addition & 5 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,5 @@
}
},
"postCreateCommand": "bash .devcontainer/post-create.sh",
"remoteUser": "vscode",
"mounts": [
"source=${localWorkspaceFolder},target=/workspace,type=bind,consistency=cached"
],
"workspaceFolder": "/workspace"
"remoteUser": "vscode"
}