generated from LEXUGE/jupyterEnv
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
50 lines (47 loc) · 1.53 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 = "Your jupyterWith project";
inputs.utils.url = "github:numtide/flake-utils";
# inputs.jupyterWith.url = "github:tweag/jupyterWith";
inputs.jupyterWith.url = "github:gtrunsec/jupyterWith/dev";
outputs =
{ self
, utils
, jupyterWith
}:
utils.lib.eachSystem
[
utils.lib.system.x86_64-linux
]
(
system:
let
inherit (jupyterWith.inputs) nixpkgs poetry2nix;
inherit (jupyterWith.lib.${system}) mkJupyterlabFromPath;
jupyterlab = mkJupyterlabFromPath ./kernels { inherit system poetry2nix nixpkgs; };
pkgs = import nixpkgs {
inherit system;
};
in
rec {
packages = { inherit jupyterlab; };
packages.default = jupyterlab;
devShells.default = pkgs.mkShell { packages = [ jupyterWith.inputs.poetry2nix.packages."${system}".poetry ]; };
apps = {
default = { type = "app"; program = "${packages.jupyterlab}/bin/jupyter-lab"; };
update-lock = jupyterWith.apps."${system}".update-poetry-lock;
fmt = utils.lib.mkApp {
drv = with pkgs;
pkgs.writeShellScriptBin "jupyter-fmt" ''
export PATH=${
pkgs.lib.strings.makeBinPath [
findutils
nixpkgs-fmt
]
}
find . -type f -name '*.nix' -exec nixpkgs-fmt {} +
'';
};
};
}
);
}