Skip to content

Commit f0d99eb

Browse files
committed
refactor: simplify devcontainer setup by removing post-create script
Change-Id: I6eed81bdda7f09f6a6ebe010ed2d6ed50366700f Signed-off-by: Thomas Kosiewski <[email protected]>
1 parent 2ce88b0 commit f0d99eb

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)