Julia: Difference between revisions
m Added a note about a potentially inaccurate statement about Julia Plots |
Added an example using the withPackages function |
||
| Line 5: | Line 5: | ||
== Packages == | == Packages == | ||
Julia packages can be installed via nix using the <code>julia.withPackages</code> function. For example:<syntaxhighlight lang="nix"> | |||
{pkgs, ...}: | |||
let | |||
myjulia = (pkgs.julia.withPackages [ | |||
"Plots" | |||
]); | |||
in | |||
{ | |||
environment.systemPackages = [ myjulia ]; | |||
home.packages = [ myjulia ]; # if using home manager | |||
} | |||
</syntaxhighlight> | |||
You can also install packages the [https://docs.julialang.org/en/v1/stdlib/Pkg/ without nix.] | |||
Some Julia packages expect binaries to be installed on your system. Until a better solution is found, you can run Julia inside [[Distrobox]]. | Some Julia packages expect binaries to be installed on your system. Until a better solution is found, you can run Julia inside [[Distrobox]]. | ||
Latest revision as of 15:09, 10 April 2026
Julia is a programming language, that aims to create an unprecedented combination of ease-of-use, power, and efficiency in a single language.
Installation And Versions
You can install the newest version of Julia either with julia-bin (the derivation which downloads the binary) or julia (the derivation which builds Julia from the source). From the end-user perspective, -bin packages should be indistinguishable from source-built ones.
Packages
Julia packages can be installed via nix using the julia.withPackages function. For example:
{pkgs, ...}:
let
myjulia = (pkgs.julia.withPackages [
"Plots"
]);
in
{
environment.systemPackages = [ myjulia ];
home.packages = [ myjulia ]; # if using home manager
}
You can also install packages the without nix.
Some Julia packages expect binaries to be installed on your system. Until a better solution is found, you can run Julia inside Distrobox.
Most notably, Julia Plots does not work. You can use Gadfly instead.
As of April 2026, the above statement is no longer accurate. Julia Plots does seem to work with no additional configuration.