Commit 7b16ea8b authored by Niclas Overby's avatar Niclas Overby
Browse files

lib: re-export missing pure builtins in lib

parent ed9dd4fa
Loading
Loading
Loading
Loading
+19 −2
Original line number Diff line number Diff line
@@ -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
+5 −0
Original line number Diff line number Diff line
@@ -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,
+6 −0
Original line number Diff line number Diff line
@@ -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

lib/flakes.nix

0 → 100644
+12 −0
Original line number Diff line number Diff line
/**
  Flake operations.
*/
{ lib }:
{

  inherit (builtins)
    parseFlakeRef
    flakeRefToString
    ;

}
+1 −0
Original line number Diff line number Diff line
@@ -39,6 +39,7 @@ rec {
    toJSON
    typeOf
    unsafeDiscardStringContext
    appendContext
    ;

  /**