nixos/portable/test.nix: Fix test

Changed files
+17 -9
nixos
modules
system
service
portable
+17 -9
nixos/modules/system/service/portable/test.nix
···
portable-lib = import ./lib.nix { inherit lib; };
dummyPkg =
name:
derivation {
···
modules = [
{
options.services = mkOption {
-
type = types.attrsOf (
-
types.submoduleWith {
-
class = "service";
-
modules = [
-
./service.nix
-
];
-
}
-
);
};
}
exampleConfig
];
};
test =
assert
-
exampleEval.config == {
services = {
service1 = {
process = {
···
portable-lib = import ./lib.nix { inherit lib; };
+
configured = portable-lib.configure {
+
serviceManagerPkgs = throw "do not use pkgs in this test";
+
extraRootModules = [ ];
+
extraRootSpecialArgs = { };
+
};
+
dummyPkg =
name:
derivation {
···
modules = [
{
options.services = mkOption {
+
type = types.attrsOf configured.serviceSubmodule;
};
}
exampleConfig
];
};
+
filterEval =
+
config:
+
lib.optionalAttrs (config ? process) {
+
inherit (config) assertions warnings process;
+
}
+
// {
+
services = lib.mapAttrs (k: filterEval) config.services;
+
};
+
test =
assert
+
filterEval exampleEval.config == {
services = {
service1 = {
process = {