Files
skyg-linux-tracker/devenv.nix
T

46 lines
1.6 KiB
Nix

{ pkgs, ... }:
{
packages = [
pkgs.git
pkgs.pkg-config
# 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/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 -- test unit|integration|lint|vm|all|ci`.
scripts.test.exec = ''nu 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, and the note goes to stderr.
# This hook cannot install zsh functions (direnv would not keep them
# 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/test.nu completions bash)
echo "test runner: 'test <subcommand>' in this shell ('test -f' stays the builtin). From outside: devenv shell -- test <subcommand>." >&2
fi
;;
esac
'';
}