74 lines
1.6 KiB
Nix
74 lines
1.6 KiB
Nix
{
|
|
pkgs,
|
|
lib,
|
|
config,
|
|
inputs,
|
|
...
|
|
}:
|
|
|
|
let
|
|
pkgs-unstable = import inputs.nixpkgs-unstable { system = pkgs.stdenv.system; };
|
|
commonLibs = with pkgs; [ alsa-lib ];
|
|
|
|
extraPackages = with pkgs; [
|
|
pkg-config
|
|
protobuf
|
|
];
|
|
in
|
|
{
|
|
imports = [ ./devenv-rust.nix ];
|
|
|
|
env = {
|
|
LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath commonLibs;
|
|
};
|
|
|
|
# https://devenv.sh/packages/
|
|
packages = commonLibs ++ extraPackages;
|
|
|
|
# https://devenv.sh/processes/
|
|
# processes.cargo-watch.exec = "cargo-watch";
|
|
|
|
# https://devenv.sh/services/
|
|
# services.postgres.enable = true;
|
|
|
|
# https://devenv.sh/scripts/
|
|
scripts.hello.exec = ''
|
|
echo Welcome to rust devenv
|
|
'';
|
|
|
|
enterShell = "";
|
|
|
|
# https://devenv.sh/tasks/
|
|
# tasks = {
|
|
# "myproj:setup".exec = "mytool build";
|
|
# "devenv:enterShell".after = [ "myproj:setup" ];
|
|
# };
|
|
|
|
# https://devenv.sh/tests/
|
|
enterTest = ''
|
|
echo "Running tests"
|
|
'';
|
|
# https://devenv.sh/git-hooks/
|
|
git-hooks.hooks = {
|
|
nixfmt.enable = true;
|
|
taplo.enable = true;
|
|
markdownlint.enable = true;
|
|
shellcheck.enable = true;
|
|
};
|
|
|
|
# https://devenv.sh/integrations/claude-code/
|
|
# Claude Code integration: writes .claude/{settings,commands,agents}. We keep
|
|
# ownership of .mcp.json (skills wiring), so stop devenv from writing it.
|
|
claude.code.enable = true;
|
|
claude.code.mcpServers = lib.mkForce { };
|
|
claude.code.hooks.git-hooks-run.command = ''
|
|
f=$(${pkgs.jq}/bin/jq -r '.tool_input.file_path // empty')
|
|
if [ -n "$f" ]; then
|
|
cd "''${CLAUDE_PROJECT_DIR:-.}"
|
|
${lib.getExe config.git-hooks.package} run --files "$f"
|
|
fi
|
|
'';
|
|
|
|
# See full reference at https://devenv.sh/reference/options/
|
|
}
|