|
1 | | -FROM mcr.microsoft.com/devcontainers/base:ubuntu-24.04 |
2 | | - |
3 | | -# Install dependencies for Nix |
4 | | -RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ |
5 | | - && apt-get -y install --no-install-recommends curl xz-utils sudo systemd \ |
6 | | - && apt-get clean && rm -rf /var/lib/apt/lists/* |
7 | | - |
8 | | -#VOLUME /nix |
9 | | - |
10 | | -RUN curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install linux \ |
11 | | - --extra-conf "sandbox = false" \ |
12 | | - --no-start-daemon \ |
13 | | - --no-confirm |
14 | | - |
15 | | -ENV PATH="/nix/var/nix/profiles/default/bin:${PATH}" |
16 | | -ENV USER=vscode |
17 | | - |
18 | | -# Basic Nix configuration (as root) |
19 | | -# Ensure /etc/nix exists before trying to write to nix.conf |
20 | | -RUN mkdir -p /etc/nix && \ |
21 | | - echo "experimental-features = nix-command flakes" >> /etc/nix/nix.conf && \ |
22 | | - echo "trusted-users = root ${USER} @wheel" >> /etc/nix/nix.conf |
23 | | - |
| 1 | +# renovate: datasource=github-tags depName=devbox packageName=jetify-com/devbox |
| 2 | +ARG DEVBOX_VERSION=0.16.0 |
| 3 | +FROM jetpackio/devbox:${DEVBOX_VERSION} |
| 4 | +ENV DEVBOX_USER=vscode |
24 | 5 | ENV HM_FLAKE_URI=github:Ramblurr/nix-agent-dev |
25 | | -RUN . /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh && \ |
26 | | - nix build --impure --no-write-lock-file "${HM_FLAKE_URI}#homeConfigurations.${USER}.activationPackage" --no-link |
27 | | - |
28 | | -USER ${USER} |
29 | | -WORKDIR /home/${USER} |
30 | | -ENV PATH="/nix/var/nix/profiles/default/bin:${PATH}" |
| 6 | +WORKDIR /home/${DEVBOX_USER} |
| 7 | + |
| 8 | +# I use devbox to install nix in a non-root docker devcontainer environment, |
| 9 | +# which the other installers (official and detsys) don't support |
| 10 | +# I dont actually use any of the devbox features |
| 11 | +COPY --chown=${DEVBOX_USER}:${DEVBOX_USER} devbox.json devbox.json |
| 12 | +COPY --chown=${DEVBOX_USER}:${DEVBOX_USER} devbox.lock devbox.lock |
| 13 | +RUN devbox install && nix-store --gc && nix build --extra-experimental-features 'nix-command flakes' --impure --no-write-lock-file "${HM_FLAKE_URI}#homeConfigurations.${DEVBOX_USER}.activationPackage" --no-link |
0 commit comments