📚 node [[20210525202211 nix_flakes]]

Nix flakes are a type of package for NixOS They are "self-contained units that have inputs (dependencies) and outputs (packages)." They are written in the Nix language.

Structure

A flake is a directory that simply contains a flake.nix file. Nix flakes are somewhat simple: they are Nix objects with an input and an output.

{
  outputs = { self }: {
    # some arbitrary output
    # `nix eval .#foo` would output "bar"
    foo = "bar";
  };
}

References

📖 stoas
⥱ context