Add all files from tviti's repo

This commit is contained in:
Doron Behar 2021-05-14 16:02:26 +03:00
commit a476a83bc7
4 changed files with 100 additions and 0 deletions

65
common.nix Normal file
View file

@ -0,0 +1,65 @@
/* This list of dependencies is based on the official Mathworks dockerfile for
R2020a, available at
https://github.com/mathworks-ref-arch/container-images
*/
{ }:
rec {
runPath = "$HOME/downloads/software/matlab/installation";
targetPkgs = pkgs:
with pkgs;
[
cacert
alsaLib # libasound2
atk
glib
glibc
cairo
cups
dbus
fontconfig
gdk-pixbuf
#gst-plugins-base
# gstreamer
gtk3
nspr
nss
pam
pango
python27
python36
python37
libselinux
libsndfile
glibcLocales
procps
unzip
zlib
gcc
gfortran
# nixos specific
udev
jre
ncurses # Needed for CLI
] ++ (with xorg; [
libSM
libX11
libxcb
libXcomposite
libXcursor
libXdamage
libXext
libXfixes
libXft
libXi
libXinerama
libXrandr
libXrender
libXt
libXtst
libXxf86vm
]);
}

9
default.nix Normal file
View file

@ -0,0 +1,9 @@
{ callPackage }:
# TODO: Be explicit about versions in file and object names!
let
common = import ./common.nix { };
in {
matlab = callPackage ./matlab.nix { inherit common; };
mlint = callPackage ./mlint.nix { inherit common; };
}

17
matlab.nix Normal file
View file

@ -0,0 +1,17 @@
{ common, writeScriptBin, buildFHSUserEnv }:
let
matlab-wrapped = with common;
writeScriptBin "matlab" ''
#!/bin/sh
export MATLAB_JAVA=/usr/lib/openjdk
export QT_QPA_PLATFORM=xcb
exec ${runPath}/bin/matlab "$@"
'';
in buildFHSUserEnv {
name = "matlab";
targetPkgs = pkgs: with pkgs; (common.targetPkgs pkgs) ++ [ matlab-wrapped ];
runScript = "${matlab-wrapped}/bin/matlab";
}

9
mlint.nix Normal file
View file

@ -0,0 +1,9 @@
{ common, buildFHSUserEnv }:
buildFHSUserEnv {
name = "mlint";
inherit (common) targetPkgs;
runScript = with common; "${runPath}/bin/glnxa64/mlint";
}