-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
52 lines (47 loc) · 1.64 KB
/
Copy pathflake.nix
File metadata and controls
52 lines (47 loc) · 1.64 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
{
description = "src_method: Successive Randomized Compression";
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
outputs =
{ self, nixpkgs }:
let
# x86_64-darwin is not supported by nixpkgs-unstable since 26.11.
systems = [
"x86_64-linux"
"aarch64-linux"
"aarch64-darwin"
];
forEachSystem = f: nixpkgs.lib.genAttrs systems (system: f nixpkgs.legacyPackages.${system});
in
{
devShells = forEachSystem (pkgs: {
default = pkgs.mkShell {
packages = [
pkgs.uv
pkgs.git
pkgs.gh
];
env = {
# Python itself and all project dependencies stay under uv's control,
# so the flake only has to provide uv and the native libraries that
# binary wheels (numpy, quimb, cupy, ...) dlopen at runtime.
UV_PYTHON_DOWNLOADS = "automatic";
}
// pkgs.lib.optionalAttrs pkgs.stdenv.hostPlatform.isLinux {
LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath [
pkgs.stdenv.cc.cc.lib
pkgs.zlib
];
};
# GPU extras are deliberately not synced: they are CUDA/ROCm specific.
shellHook = ''
uv sync --all-groups
# Activate by hand: .venv/bin/activate hardcodes paths that break
# when the checkout is shared, and uv may place the venv elsewhere.
export VIRTUAL_ENV="''${UV_PROJECT_ENVIRONMENT:-$PWD/.venv}"
export PATH="$VIRTUAL_ENV/bin:$PATH"
'';
};
});
formatter = forEachSystem (pkgs: pkgs.nixfmt);
};
}