2020-07-09 12:43:45 +02:00
|
|
|
# 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.
|
2020-07-09 12:04:40 +02:00
|
|
|
with import <nixpkgs> {};
|
|
|
|
stdenv.mkDerivation {
|
|
|
|
name = "GINsim-shell";
|
2020-07-09 12:43:45 +02:00
|
|
|
|
|
|
|
# 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.
|
2020-07-09 12:41:53 +02:00
|
|
|
buildInputs = [ (callPackage ./ginsim.nix {}) ];
|
2020-07-09 12:04:40 +02:00
|
|
|
}
|