forked from cachix/devenv
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdevenv.nix
More file actions
133 lines (120 loc) · 3.44 KB
/
devenv.nix
File metadata and controls
133 lines (120 loc) · 3.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
{ inputs
, pkgs
, lib
, config
, options
, ...
}:
{
env = {
# The path to the eval cache database (for migrations)
DATABASE_URL = "sqlite:.devenv/nix-eval-cache.db";
# The Nix CLI for devenv to use when run with `cargo run`.
DEVENV_NIX = inputs.nix.packages.${pkgs.stdenv.system}.nix-cli;
RUST_LOG = "devenv=debug";
RUST_LOG_SPAN_EVENTS = "full";
};
# Configure Claude Code
claude.code = {
enable = true;
commands = {
release = ''
Release devenv version $ARGUMENTS
1. Update version in Cargo.toml to $ARGUMENTS using `cargo set-version`
2. Run `cargo check` to update Cargo.lock
3. Generate release notes:
- Find the latest git tag
- Get the diff between that tag and HEAD
- Summarize changes into release notes format
4. Ask user for access to nixpkgs repository to bump devenv there
- The package is at pkgs/by-name/de/devenv/package.nix
- Sync with ./package.nix from this repo and bump version
5. If this is a major version bump (X.Y.0, not X.Y.Z patch):
- Generate a blog post in docs/src/blog/posts/
- Follow the naming convention: devenv-vX.Y-short-description.md
- Use existing blog posts as reference for format and style
'';
};
permissions = {
WebFetch = {
allow = [
"domain:github.com"
"domain:docs.rs"
"domain:docs.anthropic.com"
];
};
Bash = {
allow = [
"rg:*"
"cargo test:*"
"nix search:*"
"devenv-run-tests:*"
"nix-instantiate:*"
];
};
};
};
# Project dependencies
packages = [
pkgs.git
pkgs.xorg.libxcb
pkgs.yaml2json
pkgs.tesh
pkgs.watchexec
pkgs.openssl
pkgs.sqlx-cli
pkgs.process-compose
pkgs.cargo-outdated # Find outdated crates
pkgs.cargo-machete # Find unused crates
pkgs.cargo-edit # Adds the set-version command
pkgs.cargo-insta # Snapshot testing for Rust
pkgs.protobuf # snix
pkgs.dbus # secretspec
# Force compilation from source instead of binary cache
(pkgs.hello.overrideAttrs (old: {
preferLocalBuild = true;
allowSubstitutes = false;
}))
];
languages = {
# For developing the Nix modules
nix.enable = true;
# For developing the devenv CLI
rust.enable = true;
};
devcontainer = {
enable = true;
settings.customizations.vscode.extensions = [ "jnoortheen.nix-ide" ];
};
difftastic.enable = true;
scripts.devenv-generate-languages-example = {
description = "Generate an example enabling every supported language";
exec = ''
cat > examples/supported-languages/devenv.nix <<EOF
# DO NOT MODIFY.
# This file was generated by devenv-generate-languages-example.
{ pkgs, ... }: {
# Enable all languages tooling!
${lib.concatStringsSep "\n " (
map (lang: "languages.${lang}.enable = true;") (builtins.attrNames options.languages)
)}
# If you're missing a language, please contribute it by following examples of other languages <3
}
EOF
'';
};
git-hooks.package = pkgs.prek;
git-hooks.hooks = {
nixpkgs-fmt.enable = true;
rustfmt.enable = true;
markdownlint = {
settings.configuration = {
MD013 = {
line_length = 120;
};
MD033 = false;
MD034 = false;
};
};
};
}