factor out import of function.nix #14

Closed
kiara wants to merge 2 commits from reflexive-function into deployment-data-model-with-tests
2 changed files with 25 additions and 28 deletions
Showing only changes of commit 62e91e797d - Show all commits

View file

@ -15,7 +15,7 @@ let
functionTo
;
functionType = import ./function.nix { inherit lib; };
functionType = submodule ./function.nix;
application-resources = submodule {
options.resources = mkOption {
# TODO: maybe transpose, and group the resources by type instead

View file

@ -1,7 +1,7 @@
/**
Modular function type
*/
{ lib, ... }:
{ config, lib, ... }:
let
inherit (lib) mkOption types;
inherit (types)
@ -10,30 +10,27 @@ let
optionType
;
in
submodule (
{ config, ... }:
{
options = {
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;
};
};
});
};
{
options = {
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;
};
};
});
};
};
}