PLAY PODCASTS
Flake schemas (nixcon2023)

Flake schemas (nixcon2023)

Chaos Computer Club - archive feed · Eelco Dolstra

September 8, 202319m 22s

Audio is streamed directly from the publisher (cdn.media.ccc.de) as published in their RSS feed. Play Podcasts does not host this file. Rights-holders can request removal through the copyright & takedown page.

Show Notes

Flakes are a format for distributing Nix-based assets such as Nix packages, development shells, CI jobs and NixOS modules. The flake specification doesn't impose any restrictions on the contents ("outputs") of a flake, and these can be arbitrary Nix values. While this makes flakes very flexible, it means that there is no generic way to find out what a flake provides, or to check its correctness. To work around this, tools such as `nix flake show` and `nix flake check` have built-in support for a fixed set of flake output types such as `packages` and `devShells`. Unfortunately, this set cannot be extended by users to handle new flake output types. In this talk, I propose *flake schemas*, which are essentially Nix functions that enumerate the contents of a flake output, including documentation, checks and options. Flake schemas do not impose a type system on flake outputs - it is entirely up to the schema function how it checks the flake output. Flake schemas allow us to remove all output-specific code from commands like `nix flake {show, check, search}`, making it easier for developers to introduce new output types. about this event: https://talks.nixcon.org/nixcon-2023/talk/L3QVWC/

Topics

nixcon2023364212023darmstadtnixcon2023nixos