forked from tweag/jupyenv
-
Notifications
You must be signed in to change notification settings - Fork 0
/
overrides.nix
36 lines (34 loc) · 1.21 KB
/
overrides.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
pkgs: let
addNativeBuildInputs = prev: drvName: inputs: {
"${drvName}" = prev.${drvName}.overridePythonAttrs (old: {
nativeBuildInputs = (old.nativeBuildInputs or []) ++ inputs;
});
};
# A fix is on the way soon, https://github.com/nix-community/poetry2nix/pull/787
preOverlay = final: prev: {
babel = null;
Babel = null;
babel_ = prev.babel.overridePythonAttrs (old: {
nativeBuildInputs = (old.nativeBuildInputs or []) ++ [final.setuptools];
});
};
postOverlay = final: prev:
{}
// {
babel = prev.babel_;
Babel = prev.babel_;
testbook = prev.testbook.overridePythonAttrs (old: {
postPatch = ''
mkdir ./tmp
${pkgs.unzip}/bin/unzip dist/testbook-${old.version}-py3-none-any.whl -d ./tmp
sed -i -e "s|if not any(arg.startswith('--Kernel|if False and not any(arg.startswith('--Kernel|" tmp/testbook/client.py
rm dist/testbook-${old.version}-py3-none-any.whl
pushd tmp
${pkgs.zip}/bin/zip -r ../dist/testbook-${old.version}-py3-none-any.whl ./*
popd
rm -rf tmp
'';
});
};
in
(pkgs.poetry2nix.defaultPoetryOverrides.overrideOverlay preOverlay).extend postOverlay