ihaskell-docker/flake.nix
2023-04-19 06:23:43 +02:00

72 lines
2.0 KiB
Nix

{
description = "Your jupyenv project";
nixConfig.extra-substituters = [
"https://tweag-jupyter.cachix.org"
];
nixConfig.extra-trusted-public-keys = [
"tweag-jupyter.cachix.org-1:UtNH4Zs6hVUFpFBTLaA4ejYavPo5EFFqgd7G7FxGW9g="
];
inputs.flake-compat.url = "github:edolstra/flake-compat";
inputs.flake-compat.flake = false;
inputs.flake-utils.url = "github:numtide/flake-utils";
inputs.nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
inputs.jupyenv.url = "github:tweag/jupyenv";
outputs = {
self,
flake-compat,
flake-utils,
nixpkgs,
jupyenv,
...
} @ inputs:
flake-utils.lib.eachSystem
[
flake-utils.lib.system.x86_64-linux
]
(
system: let
inherit (jupyenv.lib.${system}) mkJupyterlabNew;
jupyterlab = mkJupyterlabNew ({...}: {
nixpkgs = inputs.nixpkgs;
imports = [(import ./kernels.nix)];
});
pkgs = nixpkgs.legacyPackages.${system};
in rec {
packages = {
inherit jupyterlab;
docker-image = pkgs.dockerTools.buildImage {
name = "git.pbrinkmeier.de/paul/jup";
tag = "1.6";
copyToRoot = pkgs.buildEnv {
name = "image-env";
paths = [
pkgs.coreutils
pkgs.graphviz
];
};
config = {
Env = [ "HOME=/data" ];
Cmd = [
"${jupyterlab}/bin/jupyter-lab"
"--notebook-dir=/notebooks"
"--ip=0.0.0.0"
"--no-browser"
# No authentication, has to be handled by reverse proxy!
"--ServerApp.token="
"--ServerApp.password="
"--collaborative"
];
WorkingDir = "/data";
};
};
};
packages.default = jupyterlab;
apps.default.program = "${jupyterlab}/bin/jupyter-lab";
apps.default.type = "app";
}
);
}