-
Notifications
You must be signed in to change notification settings - Fork 50
Expand file tree
/
Copy pathflake.nix
More file actions
52 lines (48 loc) · 1.48 KB
/
flake.nix
File metadata and controls
52 lines (48 loc) · 1.48 KB
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
{
description = "Learn You a Haskell for Great Good! Jupyter adaptation";
inputs.flake-utils.url = "github:numtide/flake-utils";
inputs.IHaskell.url = "github:IHaskell/IHaskell";
nixConfig = {
extra-substituters = [ "https://ihaskell.cachix.org" ];
extra-trusted-public-keys = [ "ihaskell.cachix.org-1:WoIvex/Ft/++sjYW3ntqPUL3jDGXIKDpX60pC8d5VLM="];
};
outputs = {
self,
flake-utils,
IHaskell,
...
} @ inputs:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = IHaskell.inputs.nixpkgs24_11.legacyPackages.${system};
ihaskell-env = IHaskell.packages.${system}.ihaskell-env-display-ghc98;
notebook-lyah = pkgs.stdenv.mkDerivation {
name = "notebook-lyah";
src = ./notebook;
phases = [ "unpackPhase" "installPhase" ];
installPhase = ''
mkdir -p $out
cp -r $src/* $out/
'';
};
in rec {
packages = {
inherit ihaskell-env notebook-lyah;
};
apps = {
default =
let
script = pkgs.writeShellApplication {
name = "jupyter-lab-lyah";
runtimeInputs = [ ihaskell-env notebook-lyah ];
text = "jupyter lab --notebook-dir=${notebook-lyah} ${notebook-lyah}/00-preface.ipynb";
};
in
{
type = "app";
program = "${script}/bin/jupyter-lab-lyah";
};
};
}
);
}