forked from Fediversity/Fediversity
in retrospect, just use submodule
as the import
This commit is contained in:
parent
2e91782d7e
commit
62e91e797d
2 changed files with 25 additions and 28 deletions
|
@ -15,7 +15,7 @@ let
|
||||||
functionTo
|
functionTo
|
||||||
;
|
;
|
||||||
|
|
||||||
functionType = import ./function.nix { inherit lib; };
|
functionType = submodule ./function.nix;
|
||||||
application-resources = submodule {
|
application-resources = submodule {
|
||||||
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
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/**
|
/**
|
||||||
Modular function type
|
Modular function type
|
||||||
*/
|
*/
|
||||||
{ lib, ... }:
|
{ config, lib, ... }:
|
||||||
let
|
let
|
||||||
inherit (lib) mkOption types;
|
inherit (lib) mkOption types;
|
||||||
inherit (types)
|
inherit (types)
|
||||||
|
@ -10,30 +10,27 @@ let
|
||||||
optionType
|
optionType
|
||||||
;
|
;
|
||||||
in
|
in
|
||||||
submodule (
|
{
|
||||||
{ config, ... }:
|
options = {
|
||||||
{
|
input-type = mkOption {
|
||||||
options = {
|
type = optionType;
|
||||||
input-type = mkOption {
|
|
||||||
type = optionType;
|
|
||||||
};
|
|
||||||
output-type = mkOption {
|
|
||||||
type = optionType;
|
|
||||||
};
|
|
||||||
function-type = mkOption {
|
|
||||||
type = optionType;
|
|
||||||
readOnly = true;
|
|
||||||
default = functionTo (submodule {
|
|
||||||
options = {
|
|
||||||
input = mkOption {
|
|
||||||
type = config.input-type;
|
|
||||||
};
|
|
||||||
output = mkOption {
|
|
||||||
type = config.output-type;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
});
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
}
|
output-type = mkOption {
|
||||||
)
|
type = optionType;
|
||||||
|
};
|
||||||
|
function-type = mkOption {
|
||||||
|
type = optionType;
|
||||||
|
readOnly = true;
|
||||||
|
default = functionTo (submodule {
|
||||||
|
options = {
|
||||||
|
input = mkOption {
|
||||||
|
type = config.input-type;
|
||||||
|
};
|
||||||
|
output = mkOption {
|
||||||
|
type = config.output-type;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
});
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue