This repository has been archived by the owner on May 16, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
87 lines (80 loc) · 2.37 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
{
nixConfig = {
extra-substituters = [ "https://tweag-jupyter.cachix.org" ];
extra-trusted-public-keys = [
"tweag-jupyter.cachix.org-1:UtNH4Zs6hVUFpFBTLaA4ejYavPo5EFFqgd7G7FxGW9g="
];
};
inputs = {
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable";
nixpkgs.url = "github:NixOS/nixpkgs/nixos-22.11";
flake-utils.url = "github:numtide/flake-utils";
rust-overlay.url = "github:oxalica/rust-overlay";
jupyenv.url = "github:tweag/jupyenv";
};
outputs =
{ self, nixpkgs, rust-overlay, flake-utils, jupyenv, nixpkgs-unstable }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs {
inherit system;
overlays = [
rust-overlay.overlays.default
(self: super: {
unstable = (import nixpkgs-unstable { inherit system; });
})
];
};
jupyterlab = jupyenv.lib.${system}.mkJupyterlabNew ({ ... }: {
nixpkgs = nixpkgs;
kernel.python.analysis = {
projectDir = ./analysis;
python = "python311";
enable = true;
preferWheels = true;
};
});
libraries = with pkgs; [ openmpi duckdb openssl_3 sqlite ];
packages = with pkgs;
libraries ++ [
pkg-config
minisat
cadical
mold
kissat
bacon
(rust-bin.stable.latest.default.override {
extensions = [ "rust-src" ];
targets = [ "x86_64-unknown-linux-musl" ];
})
];
in {
apps = rec {
default = lab;
lab = {
program = "${jupyterlab}/bin/jupyter-lab";
type = "app";
};
};
devShells = rec {
default = runner;
runner = pkgs.mkShell {
buildInputs = packages;
shellHook = ''
export LD_LIBRARY_PATH=${
pkgs.lib.makeLibraryPath libraries
}:$LD_LIBRARY_PATH
'';
};
docs = pkgs.mkShell {
buildInputs = with pkgs; [
python311Packages.mkdocs-material
nodePackages_latest.prettier
];
};
vm = pkgs.mkShell {
buildInputs = with pkgs; [ munge unstable.vagrant ];
};
};
});
}