diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile new file mode 100644 index 0000000..120d55e --- /dev/null +++ b/.devcontainer/Dockerfile @@ -0,0 +1,17 @@ +FROM nixos/nix + +WORKDIR /autonomy +COPY tools/nix ./tools/nix + +RUN echo "experimental-features = nix-command flakes" >> /etc/nix/nix.conf \ + && echo "sandbox = relaxed" >> /etc/nix/nix.conf \ + && echo "filter-syscalls = false" >> /etc/nix/nix.conf \ + && echo "download-buffer-size = 268435456" >> /etc/nix/nix.conf \ + && nix-channel --update \ + && nix develop ./tools/nix --command echo "Nix environment built and cached" \ + && mkdir -p /root/.local/bin \ + && mkdir -p /root/.cache + +COPY . . + +CMD ["nix", "develop", "./tools/nix", "--command", "bash"] diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 8c0f46d..4581cf2 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,4 +1,9 @@ { - "name": "Autonomy Builder", - "image": "ghcr.io/build-trust/autonomy-builder" + "name": "Builder", + "build": { + "dockerfile": "Dockerfile", + "context": ".." + }, + "workspaceFolder": "/autonomy", + "overrideCommand": false } diff --git a/.github/actions/setup_nix/action.yaml b/.github/actions/setup_nix/action.yaml index b83f5f4..3c3fa7e 100644 --- a/.github/actions/setup_nix/action.yaml +++ b/.github/actions/setup_nix/action.yaml @@ -45,6 +45,7 @@ runs: sudo mkdir -p /etc/nix echo "extra-experimental-features = flakes nix-command" > nix.conf + echo "download-buffer-size = 268435456" >> nix.conf sudo mv nix.conf /etc/nix/nix.conf # Restore nix directories from cache diff --git a/tools/docker/dev/Dockerfile b/tools/docker/dev/Dockerfile index 35efe8e..e615d10 100644 --- a/tools/docker/dev/Dockerfile +++ b/tools/docker/dev/Dockerfile @@ -6,6 +6,7 @@ COPY tools/nix ./tools/nix RUN echo "experimental-features = nix-command flakes" >> /etc/nix/nix.conf \ && echo "sandbox = relaxed" >> /etc/nix/nix.conf \ && echo "filter-syscalls = false" >> /etc/nix/nix.conf \ + && echo "download-buffer-size = 268435456" >> /etc/nix/nix.conf \ && nix-channel --update \ && nix develop ./tools/nix --command echo "Nix environment built and cached" \ && mkdir -p /root/.local/bin \