Skip to content

Instantly share code, notes, and snippets.

@nico202
Created June 16, 2017 09:54
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nico202/9377b3b378eab950dc05566e733ea320 to your computer and use it in GitHub Desktop.
Save nico202/9377b3b378eab950dc05566e733ea320 to your computer and use it in GitHub Desktop.
with import <nixpkgs> {};
{
repositoryName = stdenv.mkDerivation {
name = "repositoryName";
buildInputs = [
julia_05 # works with julia (v0.4) too
# Any other dependency you need
];
SSL_CERT_FILE="/etc/ssl/certs/ca-certificates.crt";
GIT_SSL_CAINFO="/etc/ssl/certs/ca-certificates.crt";
# First important part: Add here the dependencies the packages you want to install need
LD_LIBRARY_PATH="${glfw}/lib:${mesa}/lib:${freetype}/lib:${imagemagick}/lib:${portaudio}/lib:${libsndfile.out}/lib:${libxml2.out}/lib:${expat.out}/lib:${cairo.out}/lib:${pango.out}/lib:${gettext.out}/lib:${glib.out}/lib:${gtk3.out}/lib:${gdk_pixbuf.out}/lib:${cairo.out}:${tk.out}/lib:${tcl.out}/lib:${pkgs.sqlite.out}/lib:${pkgs.zlib}/lib";
shellHook = ''
unset http_proxy
# This is the seconnd important part. Set a relative julia_pkgdir path so that they are specific to this
# Nix env environment and are not global
export JULIA_PKGDIR=$(realpath ./.julia_pkgs)
mkdir -p $JULIA_PKGDIR
# You could also call julia -e "Pkg.init()" # and if you want install the packages you need
'';
};
}
@AttilaVM
Copy link

It worked like a charm thank you.

I defined an environment based on your work, here. Tomorrow I will make an overlay version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment