-
Notifications
You must be signed in to change notification settings - Fork 3
/
flake.nix
50 lines (46 loc) · 1.27 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
{
description = "Description for the project";
inputs = {
flake-parts.url = "github:hercules-ci/flake-parts";
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
poetry2nix = {
url = "github:nix-community/poetry2nix";
inputs.nixpkgs.follows = "nixpkgs";
};
systems.url = "github:nix-systems/default";
};
outputs = inputs @ {flake-parts, ...}:
flake-parts.lib.mkFlake {inherit inputs;} {
systems = import inputs.systems;
perSystem = {
config,
self',
inputs',
pkgs,
system,
...
}: {
devShells.default = let
# https://nixos.wiki/wiki/Python#micromamba
fhs = pkgs.buildFHSUserEnv {
name = "compas_mrr-dev";
targetPkgs = _: [
pkgs.micromamba
pkgs.act
];
profile = ''
set -e
eval "$(micromamba shell hook --shell=posix)"
export MAMBA_ROOT_PREFIX=${builtins.getEnv "PWD"}/.mamba
micromamba create -f environment.yml -y
micromamba activate compas_mrr-dev
pip install -e .
set +e
'';
};
in
fhs.env;
formatter = pkgs.alejandra;
};
};
}