-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathflake.nix
109 lines (98 loc) · 3.2 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
{
description = "oar";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.05";
flake-utils.url = "github:numtide/flake-utils";
kapack.url = "github:oar-team/nur-kapack?ref=23.05";
kapack.inputs.nixpkgs.follows = "nixpkgs";
};
outputs = { self, nixpkgs, flake-utils, kapack }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs { inherit system; };
kapackpkgs = kapack.packages.${system};
app = pkgs.python3Packages.buildPythonPackage {
format = "pyproject";
src = ./.;
nativeBuildInputs = [ pkgs.poetry-core ];
};
packageName = "oar-plugins";
in {
#pythonEnv = pkgs.python3.withPackages(ps: [ ]);
packages.${packageName} = app;
packages.documentation = pkgs.stdenv.mkDerivation {
pname = "oar3-documentation";
version = "1.0.1";
src = ./.;
buildInputs = with pkgs.python3Packages; [
(pkgs.poetry2nix.mkPoetryEnv { projectDir = self; })
sphinx
sphinx_rtd_theme
];
buildPhase = ''
export PYTHONPATH=$PYTHONPATH:$PWD
cd docs && make html
'';
installPhase = ''
mkdir -p $out
cp -r _build/html $out/
'';
};
defaultPackage = self.packages.${system}.${packageName};
devShells = {
old = pkgs.mkShell {
LD_LIBRARY_PATH = "${pkgs.stdenv.cc.cc.lib}/lib";
buildInputs = with pkgs; [
(poetry2nix.mkPoetryEnv { projectDir = self; })
# Install the entry point and the plugins
# Which is not needed anymore bc the plugins are on a new repo
# (poetry2nix.mkPoetryApplication { projectDir = self; })
python3Packages.sphinx_rtd_theme
poetry
postgresql
pre-commit
];
};
default = let
pythonEnv = with pkgs.python3Packages; [
pytest
pyzmq
requests
alembic
click
simplejson
flask
tabulate
psutil
sqlalchemy-utils
psycopg2
passlib
escapism
toml
fastapi
uvicorn
pyyaml
ptpython
python-multipart
python-jose
kapackpkgs.procset
rich
pexpect
simpy
redis
clustershell
# Dev dependencies
isort
flake8
# Docs
sphinx
sphinx-rtd-theme
flake8
];
in
pkgs.mkShell {
packages = with pkgs; [ pre-commit ] ++ pythonEnv;
};
};
});
}