From f0d99eb1e8416e815da07e38e13a3692f1e92a3d Mon Sep 17 00:00:00 2001 From: Thomas Kosiewski Date: Thu, 7 Aug 2025 21:49:35 +0200 Subject: [PATCH] refactor: simplify devcontainer setup by removing post-create script Change-Id: I6eed81bdda7f09f6a6ebe010ed2d6ed50366700f Signed-off-by: Thomas Kosiewski --- .devcontainer/Dockerfile | 24 ++++++++++-------------- .devcontainer/devcontainer.json | 6 +----- 2 files changed, 11 insertions(+), 19 deletions(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 196c503..9fb67ee 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -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 @@ -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"] \ No newline at end of file +CMD ["sleep", "infinity"] diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index b9a664f..eb62989 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -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" }