Problem
As a documentation maintainer I want to guide users into understanding the Nix language.
What's confusing is that quite many builtins are also available in the global scope for no apparent reason, although the manual says that this global attribute set is there to avoid polluting the namespace:
abort
baseNameOf
builtins (yes, recursively)
derivation
derivationStrict
dirOf
fetchGit
fetchMercurial
fetchTarball
fromTOML
import
isNull
map
placeholder
removeAttrs
scopedImport
throw
toString
@sternenseemann: a list including __* builtins
It would not suffice saying that these are for backwards compatibility, as some of them were introduced after Nix 2.0.
Checklist
Proposal
Be deliberate about it. Only make the following builtins available globally and tell why:
For general convenience:
For convenience when testing and debugging:
There may be another group for backwards compatibility, but that should, with appropriate grace periods:
- throw a warning
- throw an error
- cease existing
Problem
As a documentation maintainer I want to guide users into understanding the Nix language.
What's confusing is that quite many
builtinsare also available in the global scope for no apparent reason, although the manual says that this global attribute set is there to avoid polluting the namespace:abortbaseNameOfbuiltins(yes, recursively)derivationderivationStrictdirOffetchGitfetchMercurialfetchTarballfromTOMLimportisNullmapplaceholderremoveAttrsscopedImportthrowtoString@sternenseemann: a list including
__*builtinsIt would not suffice saying that these are for backwards compatibility, as some of them were introduced after Nix 2.0.
Checklist
Proposal
Be deliberate about it. Only make the following
builtinsavailable globally and tell why:For general convenience:
importmaptoStringFor convenience when testing and debugging:
abortthrowderivationThere may be another group for backwards compatibility, but that should, with appropriate grace periods: