refactor: clean up builder interface

This commit is contained in:
DavHau 2022-05-19 16:54:32 +02:00
parent 1215fff66b
commit efe9698305
3 changed files with 3 additions and 38 deletions

View File

@ -18,7 +18,6 @@
getCyclicDependencies, # name: version: -> [ {name=; version=; } ] getCyclicDependencies, # name: version: -> [ {name=; version=; } ]
getDependencies, # name: version: -> [ {name=; version=; } ] getDependencies, # name: version: -> [ {name=; version=; } ]
getSource, # name: version: -> store-path getSource, # name: version: -> store-path
buildPackageWithOtherBuilder, # { builder, name, version }: -> drv
# Attributes # Attributes
subsystemAttrs, # attrset subsystemAttrs, # attrset
defaultPackageName, # string defaultPackageName, # string
@ -32,10 +31,6 @@
# Example: # Example:
# produceDerivation name (mkDerivation {...}) # produceDerivation name (mkDerivation {...})
produceDerivation, produceDerivation,
# Custom Options: (parametrize builder behavior)
# These can be passed by the user via `builderArgs`.
# All options must provide default
standalonePackageNames ? [],
nodejs ? null, nodejs ? null,
... ...
} @ args: let } @ args: let

View File

@ -258,37 +258,9 @@
conditionalOverrides = packageOverrides; conditionalOverrides = packageOverrides;
}; };
buildPackageWithOtherBuilder = {
builder,
name,
version,
inject ? {},
}: let
subDreamLockLoaded = utils.readDreamLock {
dreamLock =
utils.dreamLock.getSubDreamLock dreamLock name version;
};
in
callBuilder {
inherit
builder
builderArgs
fetchedSources
inject
sourceOverrides
packageOverrides
;
dreamLock =
subDreamLockLoaded.lock;
outputs = allOutputs;
};
outputs = builder (builderArgs outputs = builder (builderArgs
// { // {
inherit inherit
buildPackageWithOtherBuilder
produceDerivation produceDerivation
dreamLock dreamLock
; ;

View File

@ -13,11 +13,13 @@
getCyclicDependencies, # name: version: -> [ {name=; version=; } ] getCyclicDependencies, # name: version: -> [ {name=; version=; } ]
getDependencies, # name: version: -> [ {name=; version=; } ] getDependencies, # name: version: -> [ {name=; version=; } ]
getSource, # name: version: -> store-path getSource, # name: version: -> store-path
buildPackageWithOtherBuilder, # { builder, name, version }: -> drv # to get information about the original source spec
getSourceSpec, # name: version: -> {type="git"; url=""; hash="";}
# Attributes # Attributes
subsystemAttrs, # attrset subsystemAttrs, # attrset
defaultPackageName, # string defaultPackageName, # string
defaultPackageVersion, # string defaultPackageVersion, # string
# all existing package names and versions
# attrset of pname -> versions, # attrset of pname -> versions,
# where versions is a list of version strings # where versions is a list of version strings
packageVersions, packageVersions,
@ -26,10 +28,6 @@
# Example: # Example:
# produceDerivation name (mkDerivation {...}) # produceDerivation name (mkDerivation {...})
produceDerivation, produceDerivation,
# Custom Options: (parametrize builder behavior)
# These can be passed by the user via `builderArgs`.
# All options must provide default
standalonePackageNames ? [],
... ...
} @ args: let } @ args: let
b = builtins; b = builtins;