mirror of
https://github.com/nix-community/dream2nix.git
synced 2024-12-23 14:31:55 +03:00
a27d3894ae
* add derived graph * rework graph sanitizing based on list keys * figure out details for builder * format stuff! * try get groups working * nodejs: fixups for new v3 builder Co-authored-by: Johannes Kirschbauer <hsjobeki@gmail.com> --------- Co-authored-by: DavHau <hsngrmpf+github@gmail.com>
80 lines
2.1 KiB
Nix
80 lines
2.1 KiB
Nix
{
|
|
pkgs ? import <nixpkgs> {},
|
|
lib ? import <nixpkgs/lib>,
|
|
inputs ? {},
|
|
dream2nix ? import ../../.. inputs,
|
|
}: let
|
|
eval = module:
|
|
lib.evalModules {
|
|
modules = [module];
|
|
specialArgs = {
|
|
inherit dream2nix;
|
|
packageSets = {
|
|
nixpkgs = pkgs;
|
|
};
|
|
};
|
|
};
|
|
in {
|
|
test_nodejs_eval_dist = let
|
|
evaled = eval ({config, ...}: {
|
|
imports = [
|
|
dream2nix.modules.dream2nix.WIP-nodejs-builder-v3
|
|
];
|
|
WIP-nodejs-builder-v3.packageLockFile = ./package-lock.json;
|
|
});
|
|
config = evaled.config;
|
|
in {
|
|
expr = lib.generators.toPretty {} config.WIP-nodejs-builder-v3.pdefs."minimal"."1.0.0".dist;
|
|
expected = "<derivation minimal-dist>";
|
|
};
|
|
|
|
test_nodejs_eval_nodeModules = let
|
|
evaled = eval ({config, ...}: {
|
|
imports = [
|
|
dream2nix.modules.dream2nix.WIP-nodejs-builder-v3
|
|
];
|
|
WIP-nodejs-builder-v3.packageLockFile = ./package-lock.json;
|
|
});
|
|
config = evaled.config;
|
|
in {
|
|
expr = lib.generators.toPretty {} config.WIP-nodejs-builder-v3.pdefs."minimal"."1.0.0".prepared-dev;
|
|
expected = "<derivation minimal-node_modules-dev>";
|
|
};
|
|
|
|
test_nodejs_root_info = let
|
|
evaled = eval ({config, ...}: {
|
|
imports = [
|
|
dream2nix.modules.dream2nix.WIP-nodejs-builder-v3
|
|
];
|
|
WIP-nodejs-builder-v3.packageLockFile = ./package-lock.json;
|
|
});
|
|
config = evaled.config;
|
|
in {
|
|
expr = {
|
|
inherit
|
|
(config.WIP-nodejs-builder-v3.pdefs."minimal"."1.0.0".info)
|
|
initialPath
|
|
initialState
|
|
;
|
|
};
|
|
expected = {
|
|
initialPath = "";
|
|
initialState = "source";
|
|
};
|
|
};
|
|
|
|
# TODO: There is no prod node_modules yet.
|
|
test_nodejs_eval_nodeModules_prod = let
|
|
evaled = eval ({config, ...}: {
|
|
imports = [
|
|
dream2nix.modules.dream2nix.WIP-nodejs-builder-v3
|
|
];
|
|
WIP-nodejs-builder-v3.packageLockFile = ./package-lock.json;
|
|
});
|
|
config = evaled.config;
|
|
in {
|
|
expr = lib.generators.toPretty {} config.WIP-nodejs-builder-v3.pdefs."minimal"."1.0.0".prepared-prod;
|
|
expected = "<derivation minimal-node_modules-prod>";
|
|
};
|
|
}
|