about summary refs log tree commit diff
path: root/pkgs/applications/science/math/mathematica
diff options
context:
space:
mode:
authorDoron Behar <doron.behar@gmail.com>2022-12-21 12:37:36 +0200
committerDoron Behar <doron.behar@gmail.com>2022-12-21 12:46:13 +0200
commit914b07da7df75d17ee6287fd69a2f42ad28898d5 (patch)
tree4d70ab4b91950227354f2af8296423f76f1d7b4b /pkgs/applications/science/math/mathematica
parent815e8e0a946613479578216b6859811a16886c45 (diff)
Mathematica: Allow overriding src directly.
Diffstat (limited to 'pkgs/applications/science/math/mathematica')
-rw-r--r--pkgs/applications/science/math/mathematica/default.nix21
1 files changed, 20 insertions, 1 deletions
diff --git a/pkgs/applications/science/math/mathematica/default.nix b/pkgs/applications/science/math/mathematica/default.nix
index a3f6a83efab1b..e2526bdffa366 100644
--- a/pkgs/applications/science/math/mathematica/default.nix
+++ b/pkgs/applications/science/math/mathematica/default.nix
@@ -5,6 +5,24 @@
 , cudaSupport ? config.cudaSupport or false
 , lang ? "en"
 , version ? null
+/*
+If you wish to completely override the src, use:
+my_mathematica = mathematica.override {
+  source = pkgs.requireFile {
+    name = "Mathematica_XX.X.X_BNDL_LINUX.sh";
+    # Get this hash via a command similar to this:
+    # nix-store --query --hash \
+    # $(nix store add-path Mathematica_XX.X.X_BNDL_LINUX.sh --name 'Mathematica_XX.X.X_BNDL_LINUX.sh')
+    sha256 = "0000000000000000000000000000000000000000000000000000";
+    message = ''
+      Your override for Mathematica includes a different src for the installer,
+      and it is missing.
+    '';
+    hashMode = "recursive";
+  };
+}
+*/
+, source ? null
 }:
 
 let versions = callPackage ./versions.nix { };
@@ -38,7 +56,8 @@ in
 
 callPackage real-drv {
   inherit cudaSupport cudaPackages;
-  inherit (found-version) version lang src;
+  inherit (found-version) version lang;
+  src = if source == null then found-version.src else source;
   name = ("mathematica"
           + lib.optionalString cudaSupport "-cuda"
           + "-${found-version.version}"