Skip to content

Commit

Permalink
julia: try falling back to "-bin" version when requested version is u…
Browse files Browse the repository at this point in the history
…nsupported
  • Loading branch information
thomasjm committed Nov 27, 2024
1 parent 9b6a7fe commit d7c692d
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion modules/kernels/julia/module.nix
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,13 @@ with lib;

config = mkIf config.kernels.julia.enable {
builtKernels.julia = config.pkgs.callPackage ./. {
julia = getAttr config.kernels.julia.juliaPackage config.pkgs;
julia = let
juliaPackage = config.kernels.julia.juliaPackage;
requestedJulia = getAttr juliaPackage config.pkgs;
in
if requestedJulia.meta.unsupported
then (if builtins.hasAttr (juliaPackage + "-bin") config.pkgs then config.pkgs.${juliaPackage + "-bin"} else throw "${juliaPackage} is not supported on this system and fallback ${juliaPackage}-bin was not found.")
else requestedJulia;

settings = config.kernels.julia;
settingsSchema = nixosOptionsToSettingsSchema { componentsToDrop = 2; } options.kernels.julia;
Expand Down

0 comments on commit d7c692d

Please sign in to comment.