Skip to content

Instantly share code, notes, and snippets.

@idontgetoutmuch
Created March 3, 2021 09:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save idontgetoutmuch/36d2ffab77defd453b779f2261890a89 to your computer and use it in GitHub Desktop.
Save idontgetoutmuch/36d2ffab77defd453b779f2261890a89 to your computer and use it in GitHub Desktop.
with import <nixpkgs> {};
with pkgs;
let
# The base Julia version
baseJulia = julia_15;
# Extra libraries for Julia's LD_LIBRARY_PATH.
# Recent Julia packages that use Artifacts.toml to specify their dependencies
# shouldn't need this.
# But if a package implicitly depends on some library being present, you can
# add it here.
extraLibs = [];
# Wrapped Julia with libraries and environment variables.
# Note: setting The PYTHON environment variable is recommended to prevent packages
# from trying to obtain their own with Conda.
julia = runCommand "julia-wrapped" { buildInputs = [makeWrapper]; } ''
mkdir -p $out/bin
makeWrapper ${baseJulia}/bin/julia $out/bin/julia \
--suffix LD_LIBRARY_PATH : "${lib.makeLibraryPath extraLibs}" \
--set PYTHON ${python3}/bin/python
'';
in
callPackage ./common.nix {
inherit julia;
# Run Pkg.precompile() to precompile all packages?
precompile = true;
# Extra arguments to makeWrapper when creating the final Julia wrapper.
# By default, it will just put the new depot at the end of JULIA_DEPOT_PATH.
# You can add additional flags here.
makeWrapperArgs = "";
}
{ pkgs ? import <nixpkgs> { config.allowBroken = true; } }:
let
julia = pkgs.julia_15.override {
# stdenv = pkgs.overrideCC pkgs.stdenv pkgs.gcc;
blas = pkgs.openblas;
};
in
pkgs.mkShell {
buildInputs = [
julia
];
MYVARIABLE = "hello";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment