-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathflake.nix
More file actions
71 lines (69 loc) · 1.9 KB
/
Copy pathflake.nix
File metadata and controls
71 lines (69 loc) · 1.9 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
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
nixpkgs_master.url = "github:NixOS/nixpkgs/master";
systems.url = "github:nix-systems/default";
flake-utils.url = "github:numtide/flake-utils";
flake-utils.inputs.systems.follows = "systems";
};
outputs =
{
self,
nixpkgs,
flake-utils,
...
}@inputs:
flake-utils.lib.eachDefaultSystem (
system:
let
pkgs = import nixpkgs {
inherit system;
config.allowUnfree = true;
};
libList = [
# Add needed packages here
pkgs.zlib # Numpy
pkgs.stdenv.cc.cc
];
in
with pkgs;
rec {
packages = import ./nix {
inherit (pkgs) lib python3Packages;
inherit pkgs;
};
devShells = {
default =
let
python_with_pkgs = pkgs.python3.withPackages (pp: [
# Add python pkgs here that you need from nix repos
packages.nahual
]);
in
mkShell {
NIX_LD_LIBRARY_PATH = lib.makeLibraryPath libList;
packages = [
python_with_pkgs
# python3Packages.venvShellHook
pkgs.uv
]
++ libList;
venvDir = "./.venv";
postVenvCreation = ''
unset SOURCE_DATE_EPOCH
'';
postShellHook = ''
unset SOURCE_DATE_EPOCH
'';
shellHook = ''
export LD_LIBRARY_PATH=$NIX_LD_LIBRARY_PATH:$LD_LIBRARY_PATH
# uv sync --all-groups
# source .venv/bin/activate
'';
};
};
}
);
}
# runHook venvShellHook # This runs nix python
# export PYTHONPATH=${python_with_pkgs}/${python_with_pkgs.sitePackages}:$PYTHONPATH