#+title: nix flakes Nix flakes are a type of package for [[file:20200629134051-nixos.org][NixOS]]. They are "self-contained units that have inputs (dependencies) and outputs (packages)." They are written in the [[file:20200629133954-nix_programming_language.org][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. #+begin_src nix :eval never { outputs = { self }: { # some arbitrary output # `nix eval .#foo` would output "bar" foo = "bar"; }; } #+end_src #+RESULTS: * References - [[https://serokell.io/blog/practical-nix-flakes][Practical Nix Flakes]] - [[https://www.tweag.io/blog/2020-05-25-flakes/][Nix Flakes, Part 1: An introduction and tutorial - Tweag]] - [[https://www.tweag.io/blog/2020-06-25-eval-cache/][Nix Flakes, Part 2: Evaluation caching - Tweag]] - [[https://www.tweag.io/blog/2020-07-31-nixos-flakes/][Nix Flakes, Part 3: Managing NixOS systems - Tweag]]