revert submodule wrapper to align with module functions already doing types #2

Closed
kiara wants to merge 37 commits from kiara/Fediversity:fix-submodule-type into main
Showing only changes of commit 8c571c2dbe - Show all commits

View file

@ -119,27 +119,29 @@ in
{ config, ... }: { config, ... }:
{ {
resources.shell.login-shell.username = "operator"; resources.shell.login-shell.username = "operator";
implementation = implementation = requests: {
requests: input = requests;
{ providers, ... }: output =
{ { providers, ... }:
providers = { {
inherit (inputs.nixops4.modules.nixops4Provider) local; providers = {
inherit (inputs.nixops4.modules.nixops4Provider) local;
};
resources.the-machine = {
type = providers.local.exec;
imports = [
inputs.nixops4-nixos.modules.nixops4Resource.nixos
];
nixos.module =
{ ... }:
{
users.users = config.resources.shell.login-shell.apply (
lib.filterAttrs (_name: value: value ? login-shell) requests
);
};
};
}; };
resources.the-machine = { };
type = providers.local.exec;
imports = [
inputs.nixops4-nixos.modules.nixops4Resource.nixos
];
nixos.module =
{ ... }:
{
users.users = config.resources.shell.login-shell.apply (
lib.filterAttrs (_name: value: value ? login-shell) requests
);
};
};
};
}; };
}; };
options = { options = {
@ -162,18 +164,20 @@ in
in in
rec { rec {
number-of-resources = with lib; length (attrNames fediversity.resources); number-of-resources = with lib; length (attrNames fediversity.resources);
config = fediversity.example-configuration; inherit (fediversity) example-configuration;
hello-package-exists = hello-package-exists =
(fediversity.applications.hello.resources config.applications.hello) (fediversity.applications.hello.resources example-configuration.applications.hello)
.resources.hello.login-shell.packages ? hello; .resources.hello.login-shell.packages ? hello;
inherit (fediversity) example-deployment;
}; };
expected = { expected = {
number-of-resources = 2; number-of-resources = 2;
config = { example-configuration = {
enable = true; enable = true;
applications.hello.enable = true; applications.hello.enable = true;
}; };
hello-package-exists = true; hello-package-exists = true;
example-deployment = { };
}; };
}; };
} }