Nix shell experience



just learned something nice today. Previously I added default.nix in my projects and configured it.

Going with this project, I realized I can get binaries on the fly.

From nix-shell --help:

-packages / -p packages...
  Set up an environment in which the specified packages are present.
  The command line arguments are interpreted as attribute names
  inside the Nix Packages collection. Thus, nix-shell -p libjpeg openjdk will
  start a shell in which the packages denoted by the attribute names
  libjpeg and openjdk are present.

Run this command in your working directory.

nix-shell -p jekyll bundler gem

And oOooo you can start the web server. Of course sometimes, you want to add new $PATH parameter or do some preprocessing stuff, this still requires a default.nix, but still nice to have feature.

See ya.

Written on October 4, 2021 at 15:10

Last but not least

If the post is updated, the creation date, will be pushed. So it might happend, you see an existing page back on frontpage. I think, this approach is valid, so wrong information or gained information is covered. But if I am going to write a new part of topic, I might include an updated link to the new post.