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.