-
Notifications
You must be signed in to change notification settings - Fork 3
/
flake.nix
60 lines (55 loc) · 1.58 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 = {
pyproject-nix.url = "github:nix-community/pyproject.nix";
pyproject-nix.inputs.nixpkgs.follows = "nixpkgs";
flake-utils.url = "github:numtide/flake-utils";
};
outputs =
{
nixpkgs,
pyproject-nix,
flake-utils,
...
}:
flake-utils.lib.eachDefaultSystem (
system:
let
inherit (nixpkgs) lib;
project = pyproject-nix.lib.project.loadPoetryPyproject { projectRoot = ./.; };
overlay = _: prev: {
python3 = prev.python3.override {
packageOverrides = _: p: {
cfgs = p.buildPythonPackage rec {
version = "0.13.0";
pname = "cfgs";
format = "pyproject";
nativeBuildInputs = with p.pythonPackages; [ poetry-core ];
src = p.fetchPypi {
inherit version pname;
hash = "sha256-zvR+Z/BRJ4Pug+JMwvOeWyO11MoMMrvXIb1k9IY2Zn4=";
};
};
};
};
};
pkgs = import nixpkgs {
inherit system;
overlays = [ overlay ];
};
python = pkgs.python3;
in
{
devShells.default =
let
arg = project.renderers.withPackages { inherit python; };
pythonEnv = python.withPackages arg;
in
pkgs.mkShell { packages = [ pythonEnv ]; };
packages.default =
let
attrs = project.renderers.buildPythonPackage { inherit python; };
in
python.pkgs.buildPythonPackage attrs;
}
);
}