{"guid":"23e5903a-e8f2-515e-9e09-be0995c75dba","title":"Flake schemas","subtitle":null,"slug":"nixcon-2023-36421-flake-schemas","link":"https://talks.nixcon.org/nixcon-2023/talk/L3QVWC/","description":"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.\n\nIn 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\ntypes.","original_language":"eng","persons":["Eelco Dolstra"],"tags":["nixcon2023","36421","2023","darmstadt","nixcon2023","nixos"],"view_count":587,"promoted":false,"date":"2023-09-08T11:04:00.000+02:00","release_date":"2023-09-08T00:00:00.000+02:00","updated_at":"2026-03-15T02:00:04.017+01:00","length":1162,"duration":1162,"thumb_url":"https://static.media.ccc.de/media/events/nixcon/2023/36421-23e5903a-e8f2-515e-9e09-be0995c75dba.jpg","poster_url":"https://static.media.ccc.de/media/events/nixcon/2023/36421-23e5903a-e8f2-515e-9e09-be0995c75dba_preview.jpg","timeline_url":"https://static.media.ccc.de/media/events/nixcon/2023/36421-23e5903a-e8f2-515e-9e09-be0995c75dba.timeline.jpg","thumbnails_url":"https://static.media.ccc.de/media/events/nixcon/2023/36421-23e5903a-e8f2-515e-9e09-be0995c75dba.thumbnails.vtt","frontend_link":"https://media.ccc.de/v/nixcon-2023-36421-flake-schemas","url":"https://api.media.ccc.de/public/events/23e5903a-e8f2-515e-9e09-be0995c75dba","conference_title":"NixCon 2023","conference_url":"https://api.media.ccc.de/public/conferences/nixcon2023","related":[],"recordings":[{"size":139,"length":1162,"mime_type":"video/webm","language":"eng","filename":"nixcon-2023-36421-eng-Flake_schemas_webm-hd.webm","state":"new","folder":"webm-hd","high_quality":true,"width":1920,"height":1080,"updated_at":"2023-09-08T15:22:05.154+02:00","recording_url":"https://cdn.media.ccc.de/events/nixcon/2023/webm-hd/nixcon-2023-36421-eng-Flake_schemas_webm-hd.webm","url":"https://api.media.ccc.de/public/recordings/70081","event_url":"https://api.media.ccc.de/public/events/23e5903a-e8f2-515e-9e09-be0995c75dba","conference_url":"https://api.media.ccc.de/public/conferences/nixcon2023"},{"size":54,"length":1162,"mime_type":"video/webm","language":"eng","filename":"nixcon-2023-36421-eng-Flake_schemas_webm-sd.webm","state":"new","folder":"webm-sd","high_quality":false,"width":720,"height":576,"updated_at":"2023-09-08T14:37:29.068+02:00","recording_url":"https://cdn.media.ccc.de/events/nixcon/2023/webm-sd/nixcon-2023-36421-eng-Flake_schemas_webm-sd.webm","url":"https://api.media.ccc.de/public/recordings/70077","event_url":"https://api.media.ccc.de/public/events/23e5903a-e8f2-515e-9e09-be0995c75dba","conference_url":"https://api.media.ccc.de/public/conferences/nixcon2023"},{"size":38,"length":1162,"mime_type":"video/mp4","language":"eng","filename":"nixcon-2023-36421-eng-Flake_schemas_sd.mp4","state":"new","folder":"h264-sd","high_quality":false,"width":720,"height":576,"updated_at":"2023-09-08T14:25:34.448+02:00","recording_url":"https://cdn.media.ccc.de/events/nixcon/2023/h264-sd/nixcon-2023-36421-eng-Flake_schemas_sd.mp4","url":"https://api.media.ccc.de/public/recordings/70076","event_url":"https://api.media.ccc.de/public/events/23e5903a-e8f2-515e-9e09-be0995c75dba","conference_url":"https://api.media.ccc.de/public/conferences/nixcon2023"},{"size":38,"length":1162,"mime_type":"video/mp4","language":"eng","filename":"nixcon-2023-36421-eng-Flake_schemas_hd-slides.mp4","state":"new","folder":"slides-h264-hd","high_quality":true,"width":1920,"height":1080,"updated_at":"2023-09-08T14:21:34.371+02:00","recording_url":"https://cdn.media.ccc.de/events/nixcon/2023/slides-h264-hd/nixcon-2023-36421-eng-Flake_schemas_hd-slides.mp4","url":"https://api.media.ccc.de/public/recordings/70075","event_url":"https://api.media.ccc.de/public/events/23e5903a-e8f2-515e-9e09-be0995c75dba","conference_url":"https://api.media.ccc.de/public/conferences/nixcon2023"},{"size":107,"length":1162,"mime_type":"video/mp4","language":"eng","filename":"nixcon-2023-36421-eng-Flake_schemas_hd.mp4","state":"new","folder":"h264-hd","high_quality":true,"width":1920,"height":1080,"updated_at":"2023-09-08T14:20:31.082+02:00","recording_url":"https://cdn.media.ccc.de/events/nixcon/2023/h264-hd/nixcon-2023-36421-eng-Flake_schemas_hd.mp4","url":"https://api.media.ccc.de/public/recordings/70074","event_url":"https://api.media.ccc.de/public/events/23e5903a-e8f2-515e-9e09-be0995c75dba","conference_url":"https://api.media.ccc.de/public/conferences/nixcon2023"}]}