forked from Fediversity/Fediversity
revert submodule
wrapper to align with module functions already doing types #2
2 changed files with 11 additions and 7 deletions
|
@ -108,13 +108,14 @@ in
|
||||||
{
|
{
|
||||||
options.enable = lib.mkEnableOption "Hello in the shell";
|
options.enable = lib.mkEnableOption "Hello in the shell";
|
||||||
};
|
};
|
||||||
implementation =
|
implementation = cfg: {
|
||||||
cfg:
|
input = cfg;
|
||||||
lib.optionalAttrs cfg.enable {
|
output = lib.optionalAttrs cfg.enable {
|
||||||
hello.login-shell.packages = {
|
resources.hello.login-shell.packages = {
|
||||||
inherit (pkgs) hello;
|
inherit (pkgs) hello;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
};
|
||||||
};
|
};
|
||||||
environments.single-nixos-vm =
|
environments.single-nixos-vm =
|
||||||
{ config, ... }:
|
{ config, ... }:
|
||||||
|
@ -161,8 +162,9 @@ in
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
in
|
in
|
||||||
{
|
rec {
|
||||||
config = fediversity.example-configuration;
|
config = fediversity.example-configuration;
|
||||||
|
resources = fediversity.applications.hello.implementation config.applications.hello;
|
||||||
};
|
};
|
||||||
expected = {
|
expected = {
|
||||||
config = {
|
config = {
|
||||||
|
|
|
@ -21,7 +21,9 @@ let
|
||||||
options.resources = mkOption {
|
options.resources = mkOption {
|
||||||
# TODO: maybe transpose, and group the resources by type instead
|
# TODO: maybe transpose, and group the resources by type instead
|
||||||
type = attrsOf (
|
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;
|
type = submodule functionType;
|
||||||
readOnly = true;
|
readOnly = true;
|
||||||
default = {
|
default = {
|
||||||
input-type = application.config.module;
|
input-type = submodule application.config.module;
|
||||||
output-type = application-resources;
|
output-type = application-resources;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Reference in a new issue