Open tejing1 opened 1 year ago
It might also be useful to allow simultaneous rewriting of multiple derivations, particularly for dealing with certain kinds of circular dependencies in other package managers?
Recording this here since it may be useful to people searching for related issues: pkgs.replaceDependency
is able to replace store paths deep in a closure, rewriting all the intermediate nodes in the DAG in the process, without recompiling anything. Nixos also has an option based on this functionality, system.replaceRuntimeDependencies
.
pkgs.replaceDependency
does use IFD, however, and as far as I know, it can't be used to alter a store path while rewriting self-references within that store path. A more comprehensive solution built into the nix language is still preferable.
Is your feature request related to a problem? Please describe. Say I want to modify the files in the chromium derivation, but compiling it is quite painful, and not necessary for the change I want to make, so rather than using
overrideAttrs
, which would compile it, I make a derivation which copies the substitutable output, then modifies it. This is almost a perfectly good solution. The only fly in the ointment is self references. However, nix already has a solution to this problem internally, since it's needed for ca-derivations... we just need to expose it to the nix language.Describe the solution you'd like Expose the hash-rewriting functionality of nix as a builtin. In particular, it needs to be able to rewrite to the (as yet unknown) resulting derivation's hash.
Example use:
Describe alternatives you've considered