Note This README is a big ToDo.
This flake provides tools for working with Python, Matlab and Julia on NixOs with
nix-ld enabled.
For Matlab to work, we also need envfs.
We largely follow the wiki to patch python
to use LD_LIBRARY_PATH according to NIX_LD_LIBRARY_PATH.
If you use this package, rebuilds will take some time.
Likewise, we patch poetry to use our custom python package.
Rebuilds will take even longer.
I have deactivated unit test by default to speed up builds.
Note
pkgs.replaceDependency might actually safe us from compile time hell, especially for large
packages like torch.
Initially inspired by nix-matlab,
I wanted to see if we can get away without an FHS.
It appears we can.
We also have a very hacky python package for the patched python.
In constrast to nix-matlab, we don't copy engine code to the nix store manually.
Instead, a shim package is generated, with a .pth file pointing at the matlab install
location.
Moreover, we exploit the fact that import lines in the .pth file are executed
to install an import hook that generates the architecture file on import.
Use nix develop with this flake to launch a shell and then install Matlab
from that shell.
Afterwards, make sure you set the environment variable MATLAB_INSTALL_DIR
to point to the install location.
In my home-manager I have
home.sessionVariables = {
MATLAB_INSTALL_DIR = "$HOME/bins/MATLAB/R2024b";
};
- Wayland: For me, the dev shell could launch the installer just fine in Wayland.
If you encounter issues, see the arch wiki. - GUI not starting: This nearly drove me crazy, because
journalctlgave messages indicating GPU issues.
But it was an incompatible library shipped with Matlab (R2024b).cd ${MATLAB_INSTALL_DIR}/sys/os/glnxa64 mv libstdc++.so.6 libstdc++.so.6.distlink
Here we draw inspiration from
scientific-fhs to download the julia binaries.
But we don't do any standard mkDerivation patching etc.
Instead we wrap the executable to use (nearly) empty LD_LIBRARY_PATH and to have
NIX_LD set correctly.
- clean-up
- examples in README
- flake templates