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
2 changed files with 11 additions and 7 deletions
Showing only changes of commit 89b22df3a4 - Show all commits

View file

@ -108,14 +108,15 @@ in
{
options.enable = lib.mkEnableOption "Hello in the shell";
};
implementation =
cfg:
lib.optionalAttrs cfg.enable {
hello.login-shell.packages = {
implementation = cfg: {
input = cfg;
output = lib.optionalAttrs cfg.enable {
resources.hello.login-shell.packages = {
inherit (pkgs) hello;
};
};
};
};
environments.single-nixos-vm =
{ config, ... }:
{
@ -161,8 +162,9 @@ in
}
);
in
{
rec {
config = fediversity.example-configuration;
resources = fediversity.applications.hello.implementation config.applications.hello;
};
expected = {
config = {

View file

@ -21,7 +21,9 @@ let
options.resources = mkOption {
# TODO: maybe transpose, and group the resources by type instead
type = attrsOf (
attrTag (lib.mapAttrs (_name: resource: mkOption { type = resource.request; }) config.resources)
attrTag (
lib.mapAttrs (_name: resource: mkOption { type = submodule resource.request; }) config.resources
)
);
};
};
@ -114,7 +116,7 @@ in
type = submodule functionType;
readOnly = true;
default = {
input-type = application.config.module;
input-type = submodule application.config.module;
output-type = application-resources;
};
};