-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
59 lines (52 loc) · 1.6 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
{
description = "Tools for working with Matlab in NixOs";
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
outputs = { self, nixpkgs }:
let
# As far as I know, Matlab only works on x86:
system = "x86_64-linux";
# Import packages:
pkgs = import nixpkgs { inherit system; };
python-pkg = pkgs.python312;
python-doCheck = false;
julia-version = "1.11.1";
julia-sha-for-version = "";
julia-add-opengl-libs = true; # so `GLMakie` works
output-set = import ./patcher.nix {
inherit pkgs;
inherit python-pkg python-doCheck;
inherit julia-version julia-sha-for-version julia-add-opengl-libs;
};
pkgs-patched = output-set.pkgs-patched;
in
rec {
inherit (output-set) ld-shellHook;
inherit (pkgs-patched) add-matlab-to-python py-pkgs-extension-matlab matlab-engine-maker;
# make patched packages availabe:
packages.${system} = {
matlab = output-set.matlab-pkg;
} // {
inherit (pkgs-patched) csh python poetry julia;
};
devShells.${system}.default = pkgs.mkShell{
shellHook = ld-shellHook;
};
tools.${system} = {
inherit (pkgs-patched) python-patcher;
};
templates = {
julia = {
description = "Devshell with unpatched Julia and preseeded library path";
path = ./templates/julia;
};
python = {
description = "Devshell with patched Python for nix-ld.";
path = ./templates/python;
};
poetry = {
description = "Devshell with patched Python and poetry for nix-ld.";
path = ./templates/poetry;
};
};
};
}