lib: re-export missing pure builtins in lib

This commit is contained in:
Niclas Overby 2026-01-23 11:34:11 +01:00
parent ed9dd4fae0
commit 7b16ea8b4e
5 changed files with 43 additions and 2 deletions

View file

@ -105,12 +105,14 @@ let
# network
network = callLibs ./network;
# flakes
flakes = callLibs ./flakes.nix;
inherit (builtins)
getContext
hasContext
convertHash
hashString
hasFile
parseDrvName
placeholder
fromJSON
@ -391,6 +393,8 @@ let
toInt
toIntBase10
fileContents
appendContext
unsafeDiscardStringContext
;
inherit (self.stringsWithDeps)
textClosureList
@ -415,7 +419,13 @@ let
renameCrossIndexTo
mapCrossIndex
;
inherit (self.derivations) lazyDerivation optionalDrvAttr warnOnInstantiate;
inherit (self.derivations)
lazyDerivation
optionalDrvAttr
warnOnInstantiate
addDrvOutputDependencies
unsafeDiscardOutputDependency
;
inherit (self.generators) mkLuaInline;
inherit (self.meta)
addMetaAttrs
@ -443,6 +453,9 @@ let
dirOf
isPath
packagesFromDirectoryRecursive
hashFile
readDir
readFileType
;
inherit (self.sources)
cleanSourceFilter
@ -593,6 +606,10 @@ let
inherit (self.network.ipv6)
mkEUI64Suffix
;
inherit (self.flakes)
parseFlakeRef
flakeRefToString
;
}
);
in

View file

@ -21,6 +21,11 @@ let
if pkg ? meta.position && isString pkg.meta.position then "${prefix}${pkg.meta.position}" else "";
in
{
inherit (builtins)
addDrvOutputDependencies
unsafeDiscardOutputDependency
;
/**
Restrict a derivation to a predictable set of attribute names, so
that the returned attrset is not strict in the actual derivation,

View file

@ -31,6 +31,12 @@ in
isPath
;
inherit (builtins)
readDir
readFileType
hashFile
;
/**
The type of a path. The path needs to exist and be accessible.
The result is either `"directory"` for a directory, `"regular"` for a

12
lib/flakes.nix Normal file
View file

@ -0,0 +1,12 @@
/**
Flake operations.
*/
{ lib }:
{
inherit (builtins)
parseFlakeRef
flakeRefToString
;
}

View file

@ -39,6 +39,7 @@ rec {
toJSON
typeOf
unsafeDiscardStringContext
appendContext
;
/**