forked from freqtrade/freqtrade
-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
60 lines (59 loc) · 1.57 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
# Run
#
# nix develop .#setupShell
#
# to install packages via pip initially (and stay in shell).
# Deletes your `.venv`!
#
# Run
#
# nix develop
#
# to get a development shell afterwards.
{
description = "Freqtrade crypto trading bot";
inputs = {
nixpkgs.url = "nixpkgs/nixos-24.05";
# or for unstable
# nixpkgs.url = "nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = {
nixpkgs,
flake-utils,
...
}:
flake-utils.lib.eachDefaultSystem (system: let
pkgs = nixpkgs.legacyPackages.${system};
buildInputs = [
(pkgs.python3.withPackages (python-pkgs: [
python-pkgs.pip
python-pkgs.virtualenv
]))
pkgs.zlib
(pkgs.ta-lib.overrideAttrs (finalAttrs: previousAttrs: {
prePatch = ''sed -i.bak "s|0.00000001|0.000000000000000001 |g" src/ta_func/ta_utility.h'';
}))
];
in {
devShells.default = pkgs.mkShell {
inherit buildInputs;
shellHook = ''
export LD_LIBRARY_PATH=${pkgs.stdenv.cc.cc.lib}/lib/
export LD_LIBRARY_PATH="${pkgs.lib.makeLibraryPath buildInputs}:$LD_LIBRARY_PATH"
source .venv/bin/activate
'';
};
devShells.setupShell = pkgs.mkShell {
inherit buildInputs;
shellHook = ''
export LD_LIBRARY_PATH=${pkgs.stdenv.cc.cc.lib}/lib/
rm -rf .venv
virtualenv --no-setuptools .venv
source .venv/bin/activate
pip install -r requirements-dev.txt
pip install -e .
'';
};
});
}