-
-
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 | |
''; | |
}; | |
} |
Hi, for some reason I have not received the notification for your comment
I'm not a nix-language expert, so I have a couple of scripts that I keep in every project, doing the required changes every time. If in those months you have answers for your first question, let me know.
Question #2: If on non-nixos systems with nix installed, those are needed to verify ssl certificates
Question #3: Some packages have separate dev and bin derivations, others are all together. So sometimes you need to use the .out to get the bins and .dev to get the headers. At least to my understanding. Those variables (inside the curly ${}) are resolved to nixos paths, so yes, they will get "installed" automatically (lazy evaluation resolves needed paths in order to build the derivation)
Question #4: can't remember, sorry
Thanks, that works! (just installed NixOs and Plots.jl)
I have a few questions :) I hope you can answer them - I am just learning Nix.
but not just
it seems to have the same effect, or am I wrong?
In
LD_LIBRARY_PATH
some variables are with.out
(likelibsndfile.out
) and some are without (likeglfw
), why? those variables are just normal packeges frompkgs
? if some of them are not present on my NixOs will they be installed automatically?(added on edit). and why does julia needs
unset http_proxy
?Thanks :)