Skip to content

Commit 1489c70

Browse files
authored
refactor: simplify devcontainer configuration and remove workspace mount (#113)
# Simplify DevContainer Configuration This PR streamlines the DevContainer setup by: 1. Standardizing indentation in the Dockerfile for better readability 2. Removing unnecessary workspace directory setup in the Dockerfile 3. Removing custom mount configuration in devcontainer.json 4. Improving formatting in devcontainer.json for better readability These changes simplify the DevContainer configuration while maintaining the core functionality of the Nix-based development environment.
1 parent 2ce88b0 commit 1489c70

File tree

2 files changed

+11
-19
lines changed

2 files changed

+11
-19
lines changed

.devcontainer/Dockerfile

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@ FROM mcr.microsoft.com/devcontainers/base:ubuntu
22

33
# Install Nix
44
RUN apt-get update && apt-get install -y \
5-
curl \
6-
xz-utils \
7-
sudo \
8-
&& rm -rf /var/lib/apt/lists/*
5+
curl \
6+
xz-utils \
7+
sudo \
8+
&& rm -rf /var/lib/apt/lists/*
99

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

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

2323
# Add Nix to PATH and configure for the shell
2424
RUN echo '. /home/vscode/.nix-profile/etc/profile.d/nix.sh' >> /home/vscode/.bashrc && \
25-
mkdir -p /home/vscode/.config/nix && \
26-
echo 'experimental-features = nix-command flakes' >> /home/vscode/.config/nix/nix.conf
27-
28-
# Set up workspace directory
29-
RUN sudo mkdir -p /workspace && sudo chown vscode:vscode /workspace
30-
WORKDIR /workspace
25+
mkdir -p /home/vscode/.config/nix && \
26+
echo 'experimental-features = nix-command flakes' >> /home/vscode/.config/nix/nix.conf
3127

3228
# Keep container running
33-
CMD ["sleep", "infinity"]
29+
CMD ["sleep", "infinity"]

.devcontainer/devcontainer.json

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,5 @@
1515
}
1616
},
1717
"postCreateCommand": "bash .devcontainer/post-create.sh",
18-
"remoteUser": "vscode",
19-
"mounts": [
20-
"source=${localWorkspaceFolder},target=/workspace,type=bind,consistency=cached"
21-
],
22-
"workspaceFolder": "/workspace"
18+
"remoteUser": "vscode"
2319
}

0 commit comments

Comments
 (0)