Skip to content

Commit 24500ab

Browse files
committed
refactor: simplify devcontainer setup by removing post-create script
Change-Id: I6eed81bdda7f09f6a6ebe010ed2d6ed50366700f Signed-off-by: Thomas Kosiewski <tk@coder.com>
1 parent 2ce88b0 commit 24500ab

File tree

3 files changed

+13
-43
lines changed

3 files changed

+13
-43
lines changed

.devcontainer/Dockerfile

Lines changed: 10 additions & 10 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,12 @@ 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
25+
mkdir -p /home/vscode/.config/nix && \
26+
echo 'experimental-features = nix-command flakes' >> /home/vscode/.config/nix/nix.conf
2727

2828
# Set up workspace directory
2929
RUN sudo mkdir -p /workspace && sudo chown vscode:vscode /workspace
3030
WORKDIR /workspace
3131

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

.devcontainer/devcontainer.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,11 @@
1111
"settings": {
1212
"terminal.integrated.defaultProfile.linux": "bash"
1313
},
14-
"extensions": ["jnoortheen.nix-ide"]
14+
"extensions": [
15+
"jnoortheen.nix-ide"
16+
]
1517
}
1618
},
17-
"postCreateCommand": "bash .devcontainer/post-create.sh",
1819
"remoteUser": "vscode",
1920
"mounts": [
2021
"source=${localWorkspaceFolder},target=/workspace,type=bind,consistency=cached"

.devcontainer/post-create.sh

Lines changed: 0 additions & 31 deletions
This file was deleted.

0 commit comments

Comments
 (0)