What's the difference between removeReferencesTo and nukeReferences?

Nixpkgs provides two similar functions for removing references to Nix store paths in derivation outputs: removeReferencesTo (and the corresponding Bash function remove-references-to) and nukeReferences (and the corresponding Bash function nuke-refs).

What are the differences between these two functions?

2 Likes

Based on the commit history: Add removeReferencesTo for removing specific refs · NixOS/nixpkgs@603b799 · GitHub

Add removeReferencesTo for removing specific refs

This allows for a less blanket approach than nuke-refs, targetting specific references that we know we don’t want rather than all references that we don’t know we want.

5 Likes