Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions docs/operations/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,18 @@ 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. 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

Use `vp run dev` for server and web, or `vp run dev:desktop` for the Electron client.
Expand Down
27 changes: 27 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

72 changes: 72 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
{
description = "T3 Code development shell";

inputs = {
# 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";
Comment thread
dasmatus marked this conversation as resolved.
Comment thread
coderabbitai[bot] marked this conversation as resolved.
};

outputs =
{ nixpkgs, ... }:
let
forAllSystems =
function:
nixpkgs.lib.genAttrs nixpkgs.lib.systems.flakeExposed (
system: function nixpkgs.legacyPackages.${system}
Comment on lines +15 to +16

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot Fix the code for this review comment.

When a review comment includes a suggested change, apply the suggestion exactly.

Do not make changes beyond what is described in the linked review comment.

);
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
Comment thread
dasmatus marked this conversation as resolved.

# 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.hostPlatform.isLinux [
gcc
pkg-config
# browser-secret helper links against the host's libsecret.
libsecret
Comment thread
dasmatus marked this conversation as resolved.
imagemagick
]
++ lib.optionals stdenv.hostPlatform.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.
Comment thread
dasmatus marked this conversation as resolved.
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
'';
};
}
);
};
}
Loading