Best way to install and use julia on Nix/NixoS

Improvements to native Julia installation on Nix are merged: Julia.withPackages improvements by thomasjm · Pull Request #433332 · NixOS/nixpkgs · GitHub

EDIT: If you also use Python or R the way packages are installed using a nix expression might be confusing so here a quick guide

Julia

# Nix compiled julia (possibly cached)
pkgs.julia.withPackages ["DataFrames" "StatsBase"]
# or Julia provided binary
pkgs.julia-bin.withPackages ["DataFrames" "StatsBase"]
# or LTS (binary?)
pkgs.julia-lts.withPackages ["DataFrames" "StatsBase"]

R

pkgs.rWrapper.override{ packages = with pkgs.rPackages; [ ggplot2 dplyr xts ]; }

Python

pkgs.python3.withPackages (python-pkgs: [
      python-pkgs.pandas
      python-pkgs.requests
    ])
3 Likes