|
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/* |
3 | 5 |
|
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" |
8 | 15 | ENV HM_FLAKE_URI=github:Ramblurr/nix-agent-dev |
9 | 16 | WORKDIR /code |
10 | | - |
11 | 17 | USER root:root |
12 | | - |
13 | 18 | RUN mkdir -p /code && chown ${DEVBOX_USER}:${DEVBOX_USER} /code |
14 | | - |
15 | 19 | 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 | | - |
20 | 20 | ENV USER=${DEVBOX_USER} |
21 | 21 | ENV NIX_CONFIG="experimental-features = nix-command flakes" |
22 | | -RUN devbox run -- echo "Installed Packages." \ |
23 | | - && nix-store --gc \ |
| 22 | +RUN nix-store --gc \ |
24 | 23 | && nix build --extra-experimental-features 'nix-command flakes' \ |
25 | 24 | --impure --no-write-lock-file --no-link --show-trace \ |
26 | 25 | "${HM_FLAKE_URI}#homeConfigurations.${DEVBOX_USER}.activationPackage" |
27 | | - |
28 | | -RUN devbox shellenv --init-hook >> ~/.profile |
0 commit comments