Flakes: what are the simplest, beginner friendly ones you have seen in the wild?

I have adopted flakes and so they are a topic I teach when introducing colleagues to nix.

I often begin writing simple flakes, but then I realized the Internet, Nix ecosystem, and you who respond to this post are an incredible resource.

What are the simplest nix flakes you have seen that are publicly available?


But the examples are not that simple if you are new.

Maybe others have better resources.


Thanks for the question!

Currently going through the process of learning to work with flakes, meanwhile having relatively limited experience with the legacy nix packaging approach.

Just recently started the following to help myself:

and to have something handy in the future in case I need to refresh my memory. I especially wanted something that is complete, meaning that nothing needs to be added to it in order to try it.

I somehow overlooked the templates mentioned by @nixinator, and will consult them in the future.

I’ve found Practical Nix Flakes quite useful.

As a newcomer it can be a bit difficult to quickly get something working based on examples, because different examples may use different approaches. For instance, the interplay between legacy nix and flakes can be coded differently. The default.nix can be imported in flake.nix or the default.nix can import the flake. When using a rust overlay, different overlays are available. If cross-compilation is needed, there seems to be different ways to go about it, etc. So it can be quite challenging to pick things up from multiple examples as different examples may use different approaches.

Hence having a rich collection of ideally fully working examples can be very useful. So far I’ve glanced at the repo of different projects I come across that are relevant to what I am working on, and that people point too. But all these projects are not so simple, so I had to pick them apart to try what I needed.


As auxilliary to everyone else’s answers, some of mine are pretty simple while still being useful, and might serve as a lightweight example for some things here and there.

I would also recommend checking out Nix Flakes: an Introduction - Xe, which is a well written introduction to the concept of flakes as a whole.


I started using flakes only after I was comfortable writing other Nix packages. However, I found the NUR template a good way to get started with “here’s my nix stuff”. https://github.com/nix-community/nur-packages-template – Maybe it’s not “simple”; but, I could use it without knowing what flakes are / without interacting with the flakes, and I could just remove the stuff I didn’t care about. I think it’s monkey-see-money-do’able.

https://github.com/nix-community/nix-direnv/ I find nix-direnv pretty neat. Since it provides a template, getting started with it (assuming direnv is installed) is simply:

nix flake new -t github:nix-community/nix-direnv

Not an example, but I have a video on flake usage:


Development environments can be very simple flakes. For example,

  description = "Development environment";
  inputs.flake-utils.url = "github:numtide/flake-utils";
  inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable-small";

  outputs =
    { self
    , flake-utils
    , nixpkgs
    flake-utils.lib.eachDefaultSystem (
        pkgs = nixpkgs.legacyPackages.${system};
        devShell = pkgs.mkShell {
          packages = with pkgs; [
            # See https://github.com/NixOS/nixpkgs/issues/59209.
          buildInputs = with pkgs; [

I am not even sure if one needs flake-utils here.


I’m pretty happy with the one for agenix:

I’ve been happy with accepting some boilerplate around multiple system types in exchange for the flake being less complex and nested.