forked from auxolotl/core
make licenses static
This commit is contained in:
parent
ff9633d02b
commit
adff8800eb
|
@ -4,46 +4,17 @@
|
||||||
* for new functions in `./tests.nix`.
|
* for new functions in `./tests.nix`.
|
||||||
*/
|
*/
|
||||||
let
|
let
|
||||||
|
loadStatic = (folder:
|
||||||
|
{
|
||||||
|
setup = builtins.fromJSON ( builtins.readFile "${folder}/static/setup.json" );
|
||||||
|
meta = builtins.fromJSON ( builtins.readFile "${folder}/static/meta.json" );
|
||||||
|
}
|
||||||
|
);
|
||||||
|
static = loadStatic ../.;
|
||||||
inherit (import ./fixed-points.nix { inherit lib; }) makeExtensible;
|
inherit (import ./fixed-points.nix { inherit lib; }) makeExtensible;
|
||||||
|
|
||||||
lib = makeExtensible (self: let
|
lib = makeExtensible (self: let
|
||||||
callLibs = file: import file { lib = self; };
|
callLibs = file: import file { lib = self; };
|
||||||
loadNode = (root: folder:
|
|
||||||
let
|
|
||||||
static = {
|
|
||||||
setup = builtins.fromJSON builtins.readFile ( "${root}/${folder}/static/setup.json" );
|
|
||||||
dependencies = builtins.fromJSON builtins.readFile ( "${root}/${folder}/static/dependencies.json" );
|
|
||||||
meta = builtins.fromJSON builtins.readFile ( "${root}/${folder}/static/meta.json" );
|
|
||||||
};
|
|
||||||
_nodeNames = (builtins.attrNames static.dependencies.nodes);
|
|
||||||
in
|
|
||||||
# basecase
|
|
||||||
if (builtins.length _nodeNames) == 0
|
|
||||||
then
|
|
||||||
{
|
|
||||||
static = static;
|
|
||||||
value = import "${root}/${folder}/default.nix";
|
|
||||||
dependencies = {};
|
|
||||||
}
|
|
||||||
# recursive case
|
|
||||||
else
|
|
||||||
{
|
|
||||||
static = static;
|
|
||||||
value = import "${root}/${folder}/default.nix";
|
|
||||||
dependencies.nodes = (builtins.listToAttrs
|
|
||||||
(builtins.map
|
|
||||||
(nodeName:
|
|
||||||
{
|
|
||||||
name = nodeName;
|
|
||||||
value = (loadNode root nodeName).value;
|
|
||||||
}
|
|
||||||
)
|
|
||||||
_nodeNames
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
);
|
|
||||||
in {
|
in {
|
||||||
builtins = builtins;
|
builtins = builtins;
|
||||||
|
|
||||||
|
@ -71,7 +42,7 @@ let
|
||||||
types = callLibs ./types.nix;
|
types = callLibs ./types.nix;
|
||||||
|
|
||||||
# constants
|
# constants
|
||||||
licenses = callLibs ./licenses.nix;
|
licenses = static.setup.licenses;
|
||||||
sourceTypes = callLibs ./source-types.nix;
|
sourceTypes = callLibs ./source-types.nix;
|
||||||
systems = callLibs ./systems;
|
systems = callLibs ./systems;
|
||||||
|
|
||||||
|
@ -192,13 +163,6 @@ let
|
||||||
inherit (self.versions)
|
inherit (self.versions)
|
||||||
splitVersion;
|
splitVersion;
|
||||||
|
|
||||||
loadStatic = (folder:
|
loadStatic = loadStatic;
|
||||||
{
|
|
||||||
setup = builtins.fromJSON ( builtins.readFile "${folder}/static/setup.json" );
|
|
||||||
dependencies = builtins.fromJSON ( builtins.readFile "${folder}/static/dependencies.json" );
|
|
||||||
meta = builtins.fromJSON ( builtins.readFile "${folder}/static/meta.json" );
|
|
||||||
}
|
|
||||||
);
|
|
||||||
loadNode = loadNode;
|
|
||||||
});
|
});
|
||||||
in lib
|
in lib
|
||||||
|
|
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue