From eeab16d03fd9216b6f59ad18bd41d08640493ef4 Mon Sep 17 00:00:00 2001 From: File Magic Date: Mon, 27 Jul 2026 21:37:55 -0400 Subject: [PATCH] .devcontainer: add devcontainer config for nix/nixos development --- .devcontainer/devcontainer-lock.json | 9 +++++++++ .devcontainer/devcontainer.json | 16 ++++++++++++++++ .devcontainer/nix.conf | 1 + 3 files changed, 26 insertions(+) create mode 100644 .devcontainer/devcontainer-lock.json create mode 100644 .devcontainer/devcontainer.json create mode 100644 .devcontainer/nix.conf diff --git a/.devcontainer/devcontainer-lock.json b/.devcontainer/devcontainer-lock.json new file mode 100644 index 0000000..62fb41f --- /dev/null +++ b/.devcontainer/devcontainer-lock.json @@ -0,0 +1,9 @@ +{ + "features": { + "ghcr.io/devcontainers/features/git:1": { + "version": "1.3.8", + "resolved": "ghcr.io/devcontainers/features/git@sha256:fd75977de13a9979000e0e78baf949adb0ca71d2398995fa22e0a36d7e7e7fe2", + "integrity": "sha256:fd75977de13a9979000e0e78baf949adb0ca71d2398995fa22e0a36d7e7e7fe2" + } + } +} diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000..916804b --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,16 @@ +{ + "name": "tangled-nix", + "image": "nixos/nix:latest", + "mounts": [ + "source=nix-store,target=/nix/store,type=volume", + "source=nix-root,target=/nix/var,type=volume", + "source=${localWorkspaceFolder}/.devcontainer/nix.conf,target=/etc/nix/nix.conf,type=bind" + ], + "containerEnv": { + "HOME": "/root", + "PATH": "/root/.nix-profile/bin:/nix/var/nix/profiles/default/bin:${containerEnv:PATH}" + }, + "remoteUser": "root", + "postCreateCommand": "nix profile add .#devShells.x86_64-linux.default && echo '[ -n \"$IN_NIX_SHELL\" ] || eval \"$(nix print-dev-env 2>/dev/null)\"' >> /root/.bashrc", + "postAttachCommand": "nix develop" +} diff --git a/.devcontainer/nix.conf b/.devcontainer/nix.conf new file mode 100644 index 0000000..c7d7291 --- /dev/null +++ b/.devcontainer/nix.conf @@ -0,0 +1 @@ +experimental-features = nix-command flakes -- 2.51.2