-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
49 lines (46 loc) · 1.47 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
{
description = "Python module for loading sound files as xarray arrays.";
inputs.nixpkgs.url = "github:nixos/nixpkgs?ref=master";
inputs.utils.url = "github:numtide/flake-utils";
outputs = { self, nixpkgs, utils }: {
overlay = final: prev: {
pythonPackagesOverrides = (prev.pythonPackagesOverrides or []) ++ [
(self: super: {
xoundfile = self.callPackage ./. {};
})
];
};
} // (utils.lib.eachSystem [ "x86_64-linux" ] (system: let
# Our own overlay does not get applied to nixpkgs because that would lead to
# an infinite recursion. Therefore, we need to import nixpkgs and apply it ourselves.
pkgs = import nixpkgs {
inherit system;
overlays = [
self.overlay
];
};
python = let
composeOverlays = pkgs.lib.foldl' pkgs.lib.composeExtensions (self: super: { });
self = pkgs.python3.override {
inherit self;
packageOverrides = composeOverlays pkgs.pythonPackagesOverrides;
};
in self;
in rec {
packages = rec {
# Development environment that includes our package, its dependencies
# and additional dev inputs.
devEnv = python.withPackages(_: pkg.allInputs);
pkg = python.pkgs.xoundfile;
};
defaultPackage = python.pkgs.xoundfile;
devShell = pkgs.mkShell {
nativeBuildInputs = [
packages.devEnv
];
shellHook = ''
export PYTHONPATH=$(readlink -f .):$PYTHONPATH
'';
};
}));
}