If you have no prior experience with functional programming, don't miss this article which explains the most important intricacies of lazy evaluation!
Overlays in Nixpkgs are a powerful mechanism, but they are also complex to grasp. We tell you everything you need to know about Nixpkgs overlays.
Not even Nixpkgs abstractions are safe from category theory
Managing runtime dependencies using NixWe’re setting up a new project at work, and wanted to apply some lessons learned from previous projects. One of the things we ran into was that when onboarding new people, or setting up a new development environment on a different machine, the dependencies were sometimes out of sync. Usually this was quite easy to fix, but keeping all the versions in sync, and dealing with deprecated or not working features (e.g terraform or kustomize) quickly becomes very annoying.Recently we ran into another issues where a newer version of java caused issues, which led to a new version of gradle, which meant updating our build files etc. While not an issue in itself, and something that we had to do eventually, but we didn’t really planned to do this at that moment.So looking around a bit we decided to look deeper into nix, and more specifically into nix-shell. This will allow us to create (and commit to git) a basic shell that will install all the dependencies we need, so everybody has the same starting point. Onboarding a new developer will then be just as easy as running:➜ nix-shell dev-env.nix➜ { dev } nixNote that in the previous shell, we’ve used the zsh nix shell extension, which make sure nix and zsh play nicely together. If we’re in a nix-shell I add the { dev } prefix to indicate thisThe biggest part of this setup is inspired on the repo from Gabriel Volpe where he explains how to use it for sbt. So for more ideas and some more advanced usages check out that one as well.Basic setupSo what do you need to do to get this working. The first thing to do is install nix itself. This can be easily done by following the instructions from here: https://nixos.org/download.html. Once installed you can use it using the nix command:$ nix --versionnix (Nix) 2.3.12There is a whole lot learning material out there on how to use nix, also for setup and managing of your own environment, but that’s a bit out of scope for this article on nix-shell. Just a
Short version On June 26th I gave a short talk at our Toronto Nix Meetup, this post is an extended version of that talk.
steen's online burrow
Michal Skalski's personal page
Alternative title:
Creating a Nix Flake for your Rust crate.
Try Nix and don't look back.
A notification bot for Matrix. Listens on HTTP and forwards to Matrix. Similar to https://ntfy.sh - arcuru/pokem