From 72aaccb4d23e712155ea3d39e0a0bc4f5ee0ba5f Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 19 Sep 2026 08:50:58 +0000 Subject: [PATCH 01/10] chore: add Nix flake dev shell Co-authored-by: dichhead <330471626+dichhead@users.noreply.github.com> --- flake.nix | 71 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 flake.nix diff --git a/flake.nix b/flake.nix new file mode 100644 index 000000000000..8c69104830b5 --- /dev/null +++ b/flake.nix @@ -0,0 +1,71 @@ +{ + description = "T3 Code development shell"; + + inputs = { + # Pinned to an exact nixpkgs-unstable commit for reproducibility. + # Bump with: nix flake update nixpkgs (then commit flake.lock) + nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; + }; + + outputs = + { nixpkgs, ... }: + let + forAllSystems = + function: + nixpkgs.lib.genAttrs nixpkgs.lib.systems.flakeExposed ( + system: function nixpkgs.legacyPackages.${system} + ); + in + { + formatter = forAllSystems (pkgs: pkgs.alejandra); + + devShells = forAllSystems ( + pkgs: + let + inherit (pkgs) lib; + in + { + default = pkgs.mkShell { + packages = + with pkgs; + [ + # Node 24 (engines.node in package.json) + pnpm for `vp i`. + nodejs_24 + pnpm + + # The `vp` repo task runner (installed separately, see below). + # Rust stable: native/resource-monitor (cargo fmt + test run in CI). + cargo + rustc + rustfmt + clippy + + # node-gyp fallback for node-pty (its prebuilds are mac/win only). + python3 + gnumake + ] + ++ lib.optionals stdenv.isLinux [ + gcc + pkg-config + # browser-secret helper links against the host's libsecret. + libsecret + ] + ++ lib.optionals stdenv.isDarwin [ + # clang toolchain for node-gyp on macOS. + clang + ]; + + # The Vite+ CLI (`vp`) is not packaged in nixpkgs. Install it once: + # curl -fsSL https://vite.plus | bash + # with VP_NODE_MANAGER=no so it reuses this shell's Node. + shellHook = '' + if ! command -v vp >/dev/null 2>&1; then + echo "note: 'vp' not found. Install it with:" >&2 + echo " curl -fsSL https://vite.plus | VP_NODE_MANAGER=no bash" >&2 + fi + ''; + }; + } + ); + }; +} From 415bfb73a73d9c3f3c527872cb8a18546ff11372 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 19 Sep 2026 08:51:49 +0000 Subject: [PATCH 02/10] docs: document Nix flake dev shell Co-authored-by: dichhead <330471626+dichhead@users.noreply.github.com> --- docs/operations/development.md | 14 ++++++++++++++ flake.nix | 4 ++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/docs/operations/development.md b/docs/operations/development.md index 1cbf09c16008..a202e65a558a 100644 --- a/docs/operations/development.md +++ b/docs/operations/development.md @@ -15,6 +15,20 @@ a new browser. Prefer a container? See [Dev container](../internals/devcontainer.md) for VS Code and Codespaces setup. +### Nix + +A `flake.nix` at the repo root provides a dev shell with the toolchain matching CI +(Node 24, pnpm, Rust stable, and the Linux desktop build prerequisites). With Nix and +flakes enabled: + +```sh +nix develop +``` + +Install the `vp` task runner once (it is not in nixpkgs); the shell prints the command +if it is missing. Then `vp i` and `vp run dev` work as above. Regenerate `flake.lock` +with `nix flake lock` when bumping the pinned nixpkgs revision. + ## Choosing a dev process Use `vp run dev` for server and web, or `vp run dev:desktop` for the Electron client. diff --git a/flake.nix b/flake.nix index 8c69104830b5..7ef8ca9a3665 100644 --- a/flake.nix +++ b/flake.nix @@ -2,8 +2,8 @@ description = "T3 Code development shell"; inputs = { - # Pinned to an exact nixpkgs-unstable commit for reproducibility. - # Bump with: nix flake update nixpkgs (then commit flake.lock) + # nixpkgs-unstable branch; the resolved revision is pinned by flake.lock. + # Regenerate with: nix flake lock (or bump with: nix flake update nixpkgs) nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; }; From f7ca4a5087617327e3c08b464e5e45bdf5e5ed3c Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 19 Sep 2026 09:06:59 +0000 Subject: [PATCH 03/10] Initial plan From 7b102ee679d6a3e2c749cb19aee48a3de0d1c26e Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 19 Sep 2026 09:08:43 +0000 Subject: [PATCH 04/10] fix(nix): add root flake lockfile Co-authored-by: dichhead <330471626+dichhead@users.noreply.github.com> --- flake.lock | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 flake.lock diff --git a/flake.lock b/flake.lock new file mode 100644 index 000000000000..de3033b7a633 --- /dev/null +++ b/flake.lock @@ -0,0 +1,27 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1786534138, + "narHash": "sha256-fBJMdnKUTUDtfi/BYLr71HLaC9dG382arxLF2Egg2uo=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "044bfe75bfe4c7bbe043dc17b5e42ea823b84a09", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} From 97525cd7fb3b83ef0907f94c44ad6796258d926a Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 19 Sep 2026 09:10:53 +0000 Subject: [PATCH 05/10] fix: add imagemagick to Linux shell and commit flake.lock Co-authored-by: dichhead <330471626+dichhead@users.noreply.github.com> --- flake.lock | 27 +++++++++++++++++++++++++++ flake.nix | 2 ++ 2 files changed, 29 insertions(+) create mode 100644 flake.lock diff --git a/flake.lock b/flake.lock new file mode 100644 index 000000000000..fe8d3b9fbdef --- /dev/null +++ b/flake.lock @@ -0,0 +1,27 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1789640129, + "narHash": "sha256-RjR8AyvGlWuw16XRj7C1YDEw4E27ciuyPeB2nDMzgTU=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "a32edd7654519351e48e80372a928df336394670", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix index 7ef8ca9a3665..38eadf8a2982 100644 --- a/flake.nix +++ b/flake.nix @@ -49,6 +49,8 @@ pkg-config # browser-secret helper links against the host's libsecret. libsecret + # dist:desktop:linux resizes the app icon with magick/convert. + imagemagick ] ++ lib.optionals stdenv.isDarwin [ # clang toolchain for node-gyp on macOS. From 470ae3498784ce5702114c7e2a7bd2fc69ae675a Mon Sep 17 00:00:00 2001 From: dichhead Date: Sat, 19 Sep 2026 11:17:34 +0200 Subject: [PATCH 06/10] Update flake.nix Co-authored-by: macroscopeapp[bot] <170038800+macroscopeapp[bot]@users.noreply.github.com> --- flake.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/flake.nix b/flake.nix index 7ef8ca9a3665..3884160418be 100644 --- a/flake.nix +++ b/flake.nix @@ -49,6 +49,7 @@ pkg-config # browser-secret helper links against the host's libsecret. libsecret + imagemagick ] ++ lib.optionals stdenv.isDarwin [ # clang toolchain for node-gyp on macOS. From e693ca14509ff692cc1031e1df0237bece523603 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 19 Sep 2026 09:17:51 +0000 Subject: [PATCH 07/10] fix: replace deprecated stdenv.isLinux/isDarwin with hostPlatform variants Co-authored-by: dichhead <330471626+dichhead@users.noreply.github.com> --- flake.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/flake.nix b/flake.nix index 38eadf8a2982..0e1902df9a48 100644 --- a/flake.nix +++ b/flake.nix @@ -44,7 +44,7 @@ python3 gnumake ] - ++ lib.optionals stdenv.isLinux [ + ++ lib.optionals stdenv.hostPlatform.isLinux [ gcc pkg-config # browser-secret helper links against the host's libsecret. @@ -52,7 +52,7 @@ # dist:desktop:linux resizes the app icon with magick/convert. imagemagick ] - ++ lib.optionals stdenv.isDarwin [ + ++ lib.optionals stdenv.hostPlatform.isDarwin [ # clang toolchain for node-gyp on macOS. clang ]; From 23b03f7fac0ad1c2f3de328ccbfe3f413fd73b11 Mon Sep 17 00:00:00 2001 From: dichhead Date: Sat, 19 Sep 2026 11:22:04 +0200 Subject: [PATCH 08/10] Update installation instructions for 'vp' task runner Clarify installation steps for the 'vp' task runner and re-entering the development shell. Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- docs/operations/development.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/docs/operations/development.md b/docs/operations/development.md index a202e65a558a..fcda170bea41 100644 --- a/docs/operations/development.md +++ b/docs/operations/development.md @@ -25,9 +25,7 @@ flakes enabled: nix develop ``` -Install the `vp` task runner once (it is not in nixpkgs); the shell prints the command -if it is missing. Then `vp i` and `vp run dev` work as above. Regenerate `flake.lock` -with `nix flake lock` when bumping the pinned nixpkgs revision. +Install the `vp` task runner once (it is not in nixpkgs); the shell prints the command if it is missing. After installing it, exit and re-enter `nix develop`, then `vp i` and `vp run dev` work as above. Regenerate `flake.lock` with `nix flake lock` when bumping the pinned nixpkgs revision. ## Choosing a dev process From fc75c36d01102865899e5cdc4f6e3442d2543b70 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 19 Sep 2026 09:36:25 +0000 Subject: [PATCH 09/10] Initial plan From 73b46f006f442b9c29455a3c24b6923a0a4a25bb Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 19 Sep 2026 09:38:00 +0000 Subject: [PATCH 10/10] fix: restore advertised nixpkgs flake pin Co-authored-by: dichhead <330471626+dichhead@users.noreply.github.com> --- flake.lock | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/flake.lock b/flake.lock index de3033b7a633..fe8d3b9fbdef 100644 --- a/flake.lock +++ b/flake.lock @@ -2,15 +2,15 @@ "nodes": { "nixpkgs": { "locked": { - "lastModified": 1786534138, - "narHash": "sha256-fBJMdnKUTUDtfi/BYLr71HLaC9dG382arxLF2Egg2uo=", - "owner": "nixos", + "lastModified": 1789640129, + "narHash": "sha256-RjR8AyvGlWuw16XRj7C1YDEw4E27ciuyPeB2nDMzgTU=", + "owner": "NixOS", "repo": "nixpkgs", - "rev": "044bfe75bfe4c7bbe043dc17b5e42ea823b84a09", + "rev": "a32edd7654519351e48e80372a928df336394670", "type": "github" }, "original": { - "owner": "nixos", + "owner": "NixOS", "ref": "nixpkgs-unstable", "repo": "nixpkgs", "type": "github"