Package a custom library mylib and use it in a program main.
Check out mylib.nix and default.nix to see how it's done.
-
Enter the environment:
cd cpp nix-shell -
Build and install
mylib:make -C mylib all install prefix=/usr/local
Adjust
prefixas necessary. -
Change the working directory to
mainand build it:cd main make
-
Run the example to see the ultimate answer:
$ ./main hello world from the #cccamp2015, the answer is 42
Serve a "Hello World" HTML page on port 8080.
-
Enter the environment:
cd go nix-shell -
Run the example:
hello-go
Download Perl 5.18.2 via WWW::Curl::Easy.
-
Enter the environment:
cd perl nix-shell -p perl perlPackages.WWWCurl
-
Run the example:
./www_curl_easy.pl
-
Enter environment:
cd python nix-shell -
Run the example to print the HTML of http://test.de:
python simpleCurl.py http://test.de
-
Enter the environment:
cd rust nix-shell -
Run the example to print
Hello, world!:$ hello-rust Hello, world!

This work (nix-shell workshop, by Joachim Schiele, seitz, Justin Humm, Lassulus, Markus Kohlhase, Alexander Flatter), identified by Eric Bailey, is free of known copyright restrictions.