summary refs log tree commit diff
path: root/pkgs/by-name/sp/spfft/package.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/by-name/sp/spfft/package.nix')
-rw-r--r--pkgs/by-name/sp/spfft/package.nix9
1 files changed, 8 insertions, 1 deletions
diff --git a/pkgs/by-name/sp/spfft/package.nix b/pkgs/by-name/sp/spfft/package.nix
index 72ae473d14a..55b20defd53 100644
--- a/pkgs/by-name/sp/spfft/package.nix
+++ b/pkgs/by-name/sp/spfft/package.nix
@@ -6,9 +6,16 @@
 , mpi
 , gfortran
 , llvmPackages
-, gpuBackend ? "none"
 , cudaPackages
 , rocmPackages
+, config
+, gpuBackend ? (
+  if config.cudaSupport
+  then "cuda"
+  else if config.rocmSupport
+  then "rocm"
+  else "none"
+)
 }:
 
 assert builtins.elem gpuBackend [ "none" "cuda" "rocm" ];