mirror of
https://github.com/nix-community/dream2nix.git
synced 2024-12-23 06:21:30 +03:00
86 lines
1.8 KiB
Nix
86 lines
1.8 KiB
Nix
{
|
|
pkgs ? import <nixpkgs> {},
|
|
lib ? import <nixpkgs/lib>,
|
|
inputs ? {},
|
|
dream2nix ? import ../../.. inputs,
|
|
}: let
|
|
eval = module:
|
|
(lib.evalModules {
|
|
modules = [
|
|
dream2nix.modules.dream2nix.core
|
|
module
|
|
];
|
|
specialArgs = {
|
|
inherit dream2nix;
|
|
packageSets.nixpkgs = pkgs;
|
|
};
|
|
})
|
|
.config;
|
|
in {
|
|
test_package_in_root_1 = let
|
|
config = eval {
|
|
paths.projectRoot = "${./.}";
|
|
paths.package = "${./.}";
|
|
};
|
|
in {
|
|
expr = {inherit (config.paths) projectRoot package;};
|
|
expected = {
|
|
projectRoot = "${./.}";
|
|
package = ".";
|
|
};
|
|
};
|
|
|
|
test_package_in_root_2 = let
|
|
config = eval {
|
|
paths.projectRoot = "${./.}";
|
|
paths.package = "./.";
|
|
};
|
|
in {
|
|
expr = {inherit (config.paths) projectRoot package;};
|
|
expected = {
|
|
projectRoot = "${./.}";
|
|
package = "./.";
|
|
};
|
|
};
|
|
|
|
test_package_in_subdir_1 = let
|
|
config = eval {
|
|
paths.projectRoot = "${./.}";
|
|
paths.package = "${./.}/package";
|
|
};
|
|
in {
|
|
expr = {inherit (config.paths) projectRoot package;};
|
|
expected = {
|
|
projectRoot = "${./.}";
|
|
package = "./package";
|
|
};
|
|
};
|
|
|
|
test_package_in_subdir_2 = let
|
|
config = eval {
|
|
paths.projectRoot = "${./.}";
|
|
paths.package = "./package";
|
|
};
|
|
in {
|
|
expr = {inherit (config.paths) projectRoot package;};
|
|
expected = {
|
|
projectRoot = "${./.}";
|
|
package = "./package";
|
|
};
|
|
};
|
|
|
|
test_package_in_subdir_3 = let
|
|
self = /nix/store/some/path;
|
|
config = eval {
|
|
paths.projectRoot = self;
|
|
paths.package = self + /package;
|
|
};
|
|
in {
|
|
expr = {inherit (config.paths) projectRoot package;};
|
|
expected = {
|
|
projectRoot = self;
|
|
package = "./package";
|
|
};
|
|
};
|
|
}
|