-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdevenv.nix
77 lines (72 loc) · 1.48 KB
/
devenv.nix
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
{ pkgs, config, ... }:
let
rootDir = config.devenv.root;
in
{
# https://devenv.sh/basics/
env = {
UV_PYTHON_DOWNLOADS = "never";
UV_PROJECT_ENVIRONMENT = "${rootDir}/.venvs/py3.12";
};
# https://devenv.sh/packages/
packages = with pkgs; [
just
watchexec
# needed for lxml
libxml2
libxslt
libz
(buildEnv {
name = "python";
paths = [
python312
python39
python310
python311
python313
uv
];
ignoreCollisions = true;
})
];
scripts.run-python-version.exec = ''
#!/usr/bin/env bash
VERSION=$1
shift
COMMAND="$@"
export UV_PROJECT_ENVIRONMENT=${rootDir}/.venvs/py$VERSION
uv run -p python$VERSION -- $COMMAND
'';
languages.javascript = {
# for compone-stories
bun.enable = true;
};
# https://devenv.sh/pre-commit-hooks/
pre-commit.default_stages = [
"pre-push"
"manual"
];
pre-commit.hooks = {
ruff = {
enable = true;
args = [
"--config"
"${rootDir}/pyproject.toml"
];
};
ruff-format.enable = true;
check-added-large-files.enable = true;
check-json.enable = true;
check-toml.enable = true;
check-yaml = {
enable = true;
excludes = [ "docs/mkdocs.yml" ];
};
trim-trailing-whitespace = {
enable = true;
excludes = [ ".*.md$" ];
};
end-of-file-fixer.enable = true;
};
# See full reference at https://devenv.sh/reference/options/
}