First you find a copy of Mathematica_13.2.1_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 version.nix to match what you have above.
Run nix hash file Mathematica_13.2.1_BNDL_LINUX.sh.
Finally, running nix-build will install Mathematica to Nix store.
Wow you're right haha. I'm going to spin up a qemu instance of NixOS. I need to see for myself. I'll try installing 13.3.1. I'll let you know about my results :)