shell.nix: Add extensive comments.

This commit is contained in:
Sergiu Ivanov 2020-07-09 12:43:45 +02:00
parent 2312ec22ad
commit 00376ab90a

View file

@ -1,5 +1,23 @@
# shell.nix
#
# Prepare a Nix shell with GINsim available.
#
# Use nix-shell or nix-shell shell.nix to start.
# The with statement imports the nixpkgs namespace, so the tools like
# stdenv and callPackage become available.
with import <nixpkgs> {}; with import <nixpkgs> {};
stdenv.mkDerivation { stdenv.mkDerivation {
name = "GINsim-shell"; name = "GINsim-shell";
# Bring the package defined in ginsim.nix in scope. buildInputs is
# therefore a one-element list. Its only element is the call of the
# anonymous function defined in ginsim.nix. I could have used let
# to define a local binding ginsim = callPackage ./ginsim.nix {}; to
# explicitly bind a name to this function call.
#
# callPackage can also be replaced by import. In this case, the
# arguments of the anonymous function defined in ginsim.nix get
# their respective default values.
buildInputs = [ (callPackage ./ginsim.nix {}) ]; buildInputs = [ (callPackage ./ginsim.nix {}) ];
} }