summaryrefslogtreecommitdiff
path: root/default.nix
blob: 8a2586ec311f0598cfa2c15bbd65b854ed5968ce (plain) (blame)
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
with import <nixpkgs> { };

let

  # werkzeug workaround related to:
  # https://github.com/NixOS/nixpkgs/issues/72345#issuecomment-812970457

  my-python-packages = (pypkgs:
    let
      werkzeug' = pypkgs.werkzeug.overrideAttrs (old: {
        postPatch = ''
          substituteInPlace src/werkzeug/_reloader.py \
            --replace "rv = [sys.executable]" "return sys.argv"
        '';
        doCheck = false;
      });

      flask' = pypkgs.flask.override { werkzeug = werkzeug'; };

    in with pypkgs; [ werkzeug' flask' pytest docopt coverage black ]);

  python' = python3.withPackages my-python-packages;

in { }:
stdenv.mkDerivation {
  name = "swap";
  buildInputs = [ python' ];
}