-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
54 lines (52 loc) · 1.21 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
{
inputs = {
poetry2nix = {
url = "github:nix-community/poetry2nix";
inputs.nixpkgs.follows = "nixpkgs";
};
alejandra = {
url = "github:kamadorueda/alejandra/3.0.0";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = inputs @ {
self,
nixpkgs,
flake-parts,
systems,
poetry2nix,
alejandra,
...
}:
flake-parts.lib.mkFlake {inherit inputs;} {
systems = import systems;
perSystem = {
pkgs,
lib,
system,
self',
...
}: let
poetryEnv = pkgs.callPackage ./. {};
in {
_module.args.pkgs = import nixpkgs {
inherit system;
overlays = [poetry2nix.overlays.default];
};
devShells.default = pkgs.mkShell {
packages = [
pkgs.poetry
poetryEnv
];
POETRY_VIRTUALENVS_IN_PROJECT = true;
shellHook = ''
${lib.getExe pkgs.poetry} env use ${lib.getExe pkgs.python3}
${lib.getExe pkgs.poetry} install --all-extras --no-root --sync
pre-commit install --overwrite
set -a
source .env 2> /dev/null
'';
};
};
};
}