Files
2026-10-21 00:01:04 -04:00

51 lines
1.7 KiB
Nix

{ pkgs, ... }:
{
imports = [ ./devenv.hooks.nix ];
packages = [
pkgs.git
pkgs.pkg-config
# Linker: .cargo/config.toml passes -fuse-ld=lld for local builds, so it
# must be on PATH in this shell.
pkgs.lld
# libsystemd.pc lives in the .dev output; the pkg-config setup hook finds
# it when the package is in `packages`.
pkgs.systemd
# Local OTLP collector for the telemetry workstream (G7).
pkgs.opentelemetry-collector-contrib
# Test runner (dev/dev-test.nu).
pkgs.nushell
];
languages.rust.enable = true;
# Local OTLP collector with a debug exporter: `devenv up`.
processes.otelcol.exec = "otelcol-contrib --config dev/otelcol.yaml";
scripts.build.exec = ''cargo build "$@"'';
scripts.run.exec = ''cargo run -- "$@"'';
scripts.smoke.exec = "cargo test --test binary_smoke -- --nocapture";
scripts.token.exec = ''cargo run -- token "$@"'';
# `devenv shell -- dev-test unit|integration|lint|vm|all|ci`.
# Quoted: a hyphen is not an identifier, so `scripts.dev-test` would subtract.
scripts."dev-test".exec = ''nu dev/dev-test.nu "$@"'';
enterShell = ''
export CLAUDE_CONFIG_DIR="$(pwd)/.claude-account"
# Interactive bash only. `devenv shell -- …` is non-interactive, so its
# stdout stays the command's own output. This hook runs in bash, so it only
# installs bash completion, and direnv will not source it either. zsh users
# source the completion script from .zshrc after compinit; see
# docs/consolidator.md.
case $- in
*i*)
if [ -n "''${BASH_VERSION:-}" ] && command -v nu >/dev/null 2>&1; then
source <(nu dev/dev-test.nu completions bash)
fi
;;
esac
'';
}