about summary refs log tree commit diff
path: root/nixpkgs/doc/languages-frameworks/julia.section.md
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2024-01-06 02:12:23 +0100
committerAlyssa Ross <hi@alyssa.is>2024-01-06 02:12:23 +0100
commitf34a1b70eb86e4a63cfb88ea460345bb1aed88e3 (patch)
tree32834d23912250e0c4b86aa4420baacf8091c0fe /nixpkgs/doc/languages-frameworks/julia.section.md
parent003ab91dd67b093890db1dd0bab564345db6e496 (diff)
parent7a7cfff8915e06365bc2365ff33d4d413184fa9f (diff)
downloadnixlib-f34a1b70eb86e4a63cfb88ea460345bb1aed88e3.tar
nixlib-f34a1b70eb86e4a63cfb88ea460345bb1aed88e3.tar.gz
nixlib-f34a1b70eb86e4a63cfb88ea460345bb1aed88e3.tar.bz2
nixlib-f34a1b70eb86e4a63cfb88ea460345bb1aed88e3.tar.lz
nixlib-f34a1b70eb86e4a63cfb88ea460345bb1aed88e3.tar.xz
nixlib-f34a1b70eb86e4a63cfb88ea460345bb1aed88e3.tar.zst
nixlib-f34a1b70eb86e4a63cfb88ea460345bb1aed88e3.zip
Merge branch 'nixos-unstable-small' of https://github.com/NixOS/nixpkgs
Conflicts:
	nixpkgs/pkgs/build-support/go/module.nix
Diffstat (limited to 'nixpkgs/doc/languages-frameworks/julia.section.md')
-rw-r--r--nixpkgs/doc/languages-frameworks/julia.section.md69
1 files changed, 69 insertions, 0 deletions
diff --git a/nixpkgs/doc/languages-frameworks/julia.section.md b/nixpkgs/doc/languages-frameworks/julia.section.md
new file mode 100644
index 000000000000..235861ac528f
--- /dev/null
+++ b/nixpkgs/doc/languages-frameworks/julia.section.md
@@ -0,0 +1,69 @@
+# Julia {#language-julia}
+
+## Introduction {#julia-introduction}
+
+Nixpkgs includes Julia as the `julia` derivation.
+You can get specific versions by looking at the other `julia*` top-level derivations available.
+For example, `julia_19` corresponds to Julia 1.9.
+We also provide the current stable version as `julia-stable`, and an LTS version as `julia-lts`.
+
+Occasionally, a Julia version has been too difficult to build from source in Nixpkgs and has been fetched prebuilt instead.
+These Julia versions are differentiated with the `*-bin` suffix; for example, `julia-stable-bin`.
+
+## julia.withPackages {#julia-withpackage}
+
+The basic Julia derivations only provide the built-in packages that come with the distribution.
+
+You can build Julia environments with additional packages using the `julia.withPackages` command.
+This function accepts a list of strings representing Julia package names.
+For example, you can build a Julia environment with the `Plots` package as follows.
+
+```nix
+julia.withPackages ["Plots"]
+```
+
+Arguments can be passed using `.override`.
+For example:
+
+```nix
+(julia.withPackages.override {
+  precompile = false; # Turn off precompilation
+}) ["Plots"]
+```
+
+Here's a nice way to run a Julia environment with a shell one-liner:
+
+```sh
+nix-shell -p 'julia.withPackages ["Plots"]' --run julia
+```
+
+### Arguments {#julia-withpackage-arguments}
+
+* `precompile`: Whether to run `Pkg.precompile()` on the generated environment.
+
+  This will make package imports faster, but may fail in some cases.
+  For example, there is an upstream issue with `Gtk.jl` that prevents precompilation from working in the Nix build sandbox, because the precompiled code tries to access a display.
+  Packages like this will work fine if you build with `precompile=false`, and then precompile as needed once your environment starts.
+
+  Defaults: `true`
+
+* `extraLibs`: Extra library dependencies that will be placed on the `LD_LIBRARY_PATH` for Julia.
+
+  Should not be needed as we try to obtain library dependencies automatically using Julia's artifacts system.
+
+* `makeWrapperArgs`: Extra arguments to pass to the `makeWrapper` call which we use to wrap the Julia binary.
+* `setDefaultDepot`: Whether to automatically prepend `$HOME/.julia` to the `JULIA_DEPOT_PATH`.
+
+  This is useful because Julia expects a writable depot path as the first entry, which the one we build in Nixpkgs is not.
+  If there's no writable depot, then Julia will show a warning and be unable to save command history logs etc.
+
+  Default: `true`
+
+* `packageOverrides`: Allows you to override packages by name by passing an alternative source.
+
+  For example, you can use a custom version of the `LanguageServer` package by passing `packageOverrides = { "LanguageServer" = fetchFromGitHub {...}; }`.
+
+* `augmentedRegistry`: Allows you to change the registry from which Julia packages are drawn.
+
+  This normally points at a special augmented version of the Julia [General packages registry](https://github.com/JuliaRegistries/General).
+  If you want to use a bleeding-edge version to pick up the latest package updates, you can plug in a later revision than the one in Nixpkgs.