env.nix 757 Bytes
Newer Older
Christoph Ruegge's avatar
Christoph Ruegge committed
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
# Build with
#
#     nix-build env.nix -o env
#
# VSCode will see the generated ./env as a virtualenv and offer it as an
# interpreter in the ‘Python: Select Interpreter’ command.
#
# To run Python with all dependencies available, use the wrapper script
# env/bin/python.

{ nixpkgs ? <nixpkgs>, pkgs ? import nixpkgs {} }:

with pkgs;

poetry2nix.mkPoetryEnv {
  projectDir = ./.;
  preferWheels = true;
  overrides = poetry2nix.overrides.withDefaults (self: super: {
    # We need to explicityly specify the dependency on the plotting backend.
    # Use tkinter for simplicity.
    matplotlib = super.matplotlib.overridePythonAttrs (attrs: {
      propagatedBuildInputs = attrs.propagatedBuildInputs ++ [
        self.tkinter
      ];
    });
  });
}