Stream: Nix toolbox devs & users

Topic: mkDerivation finalAttrs

view this post on Zulip Théo Zimmermann (Jun 03 2022 at 15:26):

I've just read this in the NixOS 22.05 release notes:

stdenv.mkDerivation now supports a self-referencing finalAttrs: parameter containing the final mkDerivation arguments including overrides. drv.overrideAttrs now supports two parameters finalAttrs: previousAttrs:. This allows packaging configuration to be overridden in a consistent manner by providing an alternative to rec {} syntax.

Additionally, passthru can now reference finalAttrs.finalPackage containing the final package, including attributes such as the output paths and overrideAttrs.

New language integrations can be simplified by overriding a “prototype” package containing the language-specific logic. This removes the need for a extra layer of overriding for the “generic builder” arguments, thus removing a usability problem and source of error.

It looks like it could be relevant to mkCoqDerivation, e.g., to avoid this typical issue.

@Vincent Laporte @Cyril Cohen WDYT?

view this post on Zulip Vincent Laporte (Jun 03 2022 at 16:20):

Sounds interesting. Thanks for pointing this out.

Last updated: Jan 29 2023 at 16:02 UTC