Skip to content

Commit 57f985a

Browse files
committed
no devbox
1 parent 0da355b commit 57f985a

File tree

1 file changed

+14
-17
lines changed

1 file changed

+14
-17
lines changed

.devcontainer/Dockerfile

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,25 @@
1-
# renovate: datasource=github-tags depName=devbox packageName=jetify-com/devbox
2-
ARG DEVBOX_VERSION=0.16.0
1+
FROM mcr.microsoft.com/devcontainers/base:ubuntu-24.04
2+
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
3+
&& apt-get -y install --no-install-recommends curl xz-utils sudo \
4+
&& apt-get clean && rm -rf /var/lib/apt/lists/*
35

4-
# I use devbox to install nix in a non-root docker devcontainer environment,
5-
# which the other installers (official and detsys) don't support
6-
# I dont actually use any of the devbox features
7-
FROM jetpackio/devbox:${DEVBOX_VERSION}
6+
USER root
7+
ENV DEVBOX_USER=vscode
8+
RUN usermod -aG sudo $DEVBOX_USER
9+
RUN echo "${DEVBOX_USER} ALL=(ALL:ALL) NOPASSWD: ALL" | sudo tee /etc/sudoers.d/$DEVBOX_USER
10+
USER $DEVBOX_USER
11+
12+
RUN wget --output-document=/dev/stdout https://nixos.org/nix/install | sh -s -- --no-daemon
13+
RUN . ~/.nix-profile/etc/profile.d/nix.sh
14+
ENV PATH="/home/${DEVBOX_USER}/.nix-profile/bin:$PATH"
815
ENV HM_FLAKE_URI=github:Ramblurr/nix-agent-dev
916
WORKDIR /code
10-
1117
USER root:root
12-
1318
RUN mkdir -p /code && chown ${DEVBOX_USER}:${DEVBOX_USER} /code
14-
1519
USER ${DEVBOX_USER}:${DEVBOX_USER}
16-
17-
COPY --chown=${DEVBOX_USER}:${DEVBOX_USER} devbox.json devbox.json
18-
COPY --chown=${DEVBOX_USER}:${DEVBOX_USER} devbox.lock devbox.lock
19-
2020
ENV USER=${DEVBOX_USER}
2121
ENV NIX_CONFIG="experimental-features = nix-command flakes"
22-
RUN devbox run -- echo "Installed Packages." \
23-
&& nix-store --gc \
22+
RUN nix-store --gc \
2423
&& nix build --extra-experimental-features 'nix-command flakes' \
2524
--impure --no-write-lock-file --no-link --show-trace \
2625
"${HM_FLAKE_URI}#homeConfigurations.${DEVBOX_USER}.activationPackage"
27-
28-
RUN devbox shellenv --init-hook >> ~/.profile

0 commit comments

Comments
 (0)