Skip to content

Instantly share code, notes, and snippets.

@kinnala
Last active April 6, 2024 18:38
Show Gist options
  • Save kinnala/b45c0ce0b2670be6cdaffb9b6e9ec6f3 to your computer and use it in GitHub Desktop.
Save kinnala/b45c0ce0b2670be6cdaffb9b6e9ec6f3 to your computer and use it in GitHub Desktop.
Install Mathematica in NixOS

This is a remainder for myself because I need to run Mathematica once a year. Often the version I use is different from nixpkgs.

First you find a copy of Mathematica_12.1.0_LINUX.sh or similar and find its sha256sum. Then you go to nixpkgs and copy all Mathematica files to a local directory. You need to modify default.nix and wrap its contents into

let pkgs = import <nixpkgs> {};
in pkgs.callPackage (
  # whatever is in default.nix
) {}

Next modify sha256 checksum and filename in l10n.nix to match what you have above. Run nix-store --add-fixed sha256 Mathematica_12.1.0_LINUX.sh. Finally, running nix-build default.nix will install Mathematica to Nix store.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment