-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathflake.nix
32 lines (32 loc) · 1.01 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
{
description = "Python-Nix interop";
inputs = {
nix.url = "github:tweag/nix/nix-c-bindings";
nixpkgs.follows = "nix/nixpkgs";
};
outputs = { self, nix, nixpkgs, flake-utils, ... }@inputs:
let systems = builtins.attrNames nix.packages;
in flake-utils.lib.eachSystem systems (system:
let
pkgs = nixpkgs.legacyPackages.${system};
nix = inputs.nix.packages.${system}.default;
inherit (pkgs) python3;
in {
devShells.env = pkgs.mkShell {
buildInputs = [ nix (python3.withPackages (_: [self.packages.${system}.default])) ];
};
devShells.default = pkgs.mkShell {
buildInputs = with pkgs; [
(python3.withPackages
(p: [ p.cffi p.pkgconfig p.setuptools p.build p.sphinx ]))
nix # from flake input
pkg-config
ruff
black
mypy
];
};
packages.default =
python3.pkgs.callPackage ./package.nix { inherit nix; };
});
}