forked from crypto-com/pystarport
-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
60 lines (60 loc) · 1.98 KB
/
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/release-22.11";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, flake-utils }:
(flake-utils.lib.eachDefaultSystem (system:
let
pkgs = (import nixpkgs { inherit system; config = { }; });
overrides = pkgs.poetry2nix.overrides.withDefaults (pkgs.lib.composeManyExtensions [
(self: super:
let
buildSystems = {
eth-bloom = [ "setuptools" ];
cprotobuf = [ "setuptools" ];
durations = [ "setuptools" ];
multitail2 = [ "setuptools" ];
pytest-github-actions-annotate-failures = [ "setuptools" ];
flake8-black = [ "setuptools" ];
multiaddr = [ "setuptools" ];
};
in
pkgs.lib.mapAttrs
(attr: systems: super.${attr}.overridePythonAttrs
(old: {
nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ map (a: self.${a}) systems;
}))
buildSystems
)
(self: super: {
eth-bloom = super.eth-bloom.overridePythonAttrs {
preConfigure = ''
substituteInPlace setup.py --replace \'setuptools-markdown\' ""
'';
};
pyyaml-include = super.pyyaml-include.overridePythonAttrs {
preConfigure = ''
substituteInPlace setup.py --replace "setup()" "setup(version=\"1.3\")"
'';
};
})
]);
in
rec {
packages.default = pkgs.poetry2nix.mkPoetryApplication
{
projectDir = ./.;
inherit overrides;
};
apps.default = {
type = "app";
program = "${packages.default}/bin/pystarport";
};
devShell = pkgs.poetry2nix.mkPoetryEnv {
projectDir = ./.;
inherit overrides;
};
}
));
}