-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
46 lines (45 loc) · 1.44 KB
/
flake.nix
File metadata and controls
46 lines (45 loc) · 1.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
#Default Flake
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-25.11";
systems.url = "github:nix-systems/default"; # can run on all systems
};
outputs = { self, nixpkgs, systems, ... }:
let
inherit (nixpkgs) lib;
eachSystem = fn: nixpkgs.lib.genAttrs (import systems) (system: fn system (import nixpkgs {
inherit system;
}));
in
{
devShells = eachSystem (system: pkgs: {
default = pkgs.mkShell {
packages = with pkgs; [
# Development
python312 #python 3.12
uv # package management
ruff # formatter/linter
# Testing
];
env =
{
# Prevent uv from managing Python downloads
UV_PYTHON_DOWNLOADS = "never";
# Force uv to use nixpkgs Python interpreter
UV_PYTHON = pkgs.python312.interpreter;
UV_LINK_MODE = "copy";
}
// lib.optionalAttrs pkgs.stdenv.isLinux {
# Python libraries often load native shared objects using dlopen(3).
# Setting LD_LIBRARY_PATH makes the dynamic library loader aware of libraries without using RPATH for lookup.
LD_LIBRARY_PATH = lib.makeLibraryPath pkgs.pythonManylinuxPackages.manylinux1;
};
shellHook = ''
unset PYTHONPATH
uv sync --all-groups
uv run pre-commit install
'';
};
});
};
}