-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdevshell.nix
44 lines (42 loc) · 1.02 KB
/
devshell.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
{pkgs}: let
pythonCommand = "uv run python \"$@\"";
in
pkgs.mkShellNoCC {
# resolve dynamic library paths
LD_LIBRARY_PATH = "${(with pkgs;
lib.makeLibraryPath [
zlib
zstd
stdenv.cc.cc
curl
openssl
attr
libssh
bzip2
libxml2
acl
libsodium
util-linux
xz
systemd
glib.out
])}:${pkgs.libGL}/lib"; # libGL don't work for makeLibraryPath
preferLocalBuild = true;
packages = with pkgs; [
uv
alejandra
# aliases
(writeShellScriptBin "py3" pythonCommand)
(writeShellScriptBin "py" pythonCommand)
(writeShellScriptBin "python" pythonCommand)
(writeShellScriptBin "python3" pythonCommand)
(writeShellScriptBin "black" "uv run black \"$@\"")
(writeShellScriptBin "pytest" "uv run pytest \"$@\"")
(writeShellScriptBin "isort" "uv run isort \"$@\"")
];
shellHook = ''
uv run python --version
uv sync
alejandra .
'';
}