-
Notifications
You must be signed in to change notification settings - Fork 12
/
flake.nix
47 lines (39 loc) · 1.38 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
{
description = "Ducc development environment";
inputs = {
nixpkgs.url = "nixpkgs/nixpkgs-unstable";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs { inherit system; };
py-pkgs = pkgs.python3Packages;
src = ./.;
ducc = py-pkgs.buildPythonPackage {
pname = "ducc0";
version = "0.35.0";
inherit src;
pyproject = true;
build-system = with py-pkgs; [ setuptools ];
dependencies = with py-pkgs; [ numpy scipy pybind11 ];
checkInputs = [ py-pkgs.pytestCheckHook ];
pythonImportsCheck = [ "ducc0" ];
DUCC0_OPTIMIZATION = "portable-strip";
postInstall = ''
mkdir -p $out/include/ducc0
cp -r $src/src/ducc0/* $out/include/ducc0
'';
};
in {
# Run `nix build .` to build the python ducc package and run the tests.
packages.default = ducc;
# Run `nix develop .` to enter the development shell. Then compile ducc
# with, e.g., `pip3 install .`
devShells.default = pkgs.mkShell {
buildInputs = ducc.dependencies ++ ducc.build-system
++ (with py-pkgs; [ venvShellHook matplotlib ]);
venvDir = ".nix-venv";
};
});
}