-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpython-flake.nix
39 lines (36 loc) · 1016 Bytes
/
python-flake.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
{
description = "Nix Development Flake for your package";
inputs.nixpkgs.url = "github:NixOS/nixpkgs/master";
outputs =
{ self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem
(system:
let
pkgs = import nixpkgs { inherit system; };
python = pkgs.python310;
pythonPackages = python.pkgs;
in
{
devShells.default = pkgs.mkShell {
name = "your_package";
nativeBuildInputs = [ pkgs.bashInteractive ];
buildInputs = with pythonPackages; [
pkgs.nodePackages.pyright
pkgs.poetry
setuptools
wheel
venvShellHook
];
venvDir = ".venv";
src = null;
postVenv = ''
unset SOURCE_DATE_EPOCH
'';
postShellHook = ''
unset SOURCE_DATE_EPOCH
unset LD_PRELOAD
PYTHONPATH=$PWD/$venvDir/${python.sitePackages}:$PYTHONPATH
'';
};
});
}