-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
39 lines (39 loc) · 1.07 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
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
flake-parts.url = "github:hercules-ci/flake-parts";
systems.url = "github:nix-systems/default";
};
outputs = inputs @ {
nixpkgs,
flake-parts,
systems,
...
}:
flake-parts.lib.mkFlake {inherit inputs;} {
systems = import systems;
perSystem = {
pkgs,
lib,
...
}: let
python = pkgs.python311;
poetry = pkgs.poetry;
# https://github.com/NixOS/nixpkgs/pull/225937
mkShell =
if pkgs.stdenv.isDarwin
then pkgs.mkShell.override {stdenv = pkgs.llvmPackages.libcxxStdenv;}
else pkgs.mkShell;
in {
devShells.default = mkShell {
packages = [poetry python];
POETRY_VIRTUALENVS_IN_PROJECT = true;
LD_LIBRARY_PATH = lib.makeLibraryPath [pkgs.stdenv.cc.cc];
shellHook = ''
${lib.getExe poetry} env use ${lib.getExe python}
${lib.getExe poetry} install --all-extras --no-root --sync
'';
};
};
};
}