Compare commits

..

No commits in common. "89b22df3a46b9c5c041b780ca0eceb942e5a6b96" and "bf488f89e120242dcf0509bbf51eef6219067a58" have entirely different histories.

3 changed files with 16 additions and 34 deletions

View file

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

View file

@ -17,28 +17,15 @@ let
;
functionType = import ./function.nix;
application-resources = submodule {
application-resources = {
options.resources = mkOption {
# TODO: maybe transpose, and group the resources by type instead
type = attrsOf (
attrTag (
lib.mapAttrs (_name: resource: mkOption { type = submodule resource.request; }) config.resources
)
attrTag (lib.mapAttrs (_name: resource: mkOption { type = resource.request; }) config.resources)
);
};
};
nixops4Deployment = types.deferredModuleWith {
staticModules = [
inputs.nixops4.modules.nixops4Deployment.default
{
_module.args = {
resourceProviderSystem = builtins.currentSystem;
resources = { };
};
}
];
};
nixops4Deployment = inputs.nixops4.modules.nixops4Deployment.default;
in
{
options = {
@ -116,7 +103,7 @@ in
type = submodule functionType;
readOnly = true;
default = {
input-type = submodule application.config.module;
input-type = application.config.module;
output-type = application-resources;
};
};

View file

@ -5,6 +5,7 @@
let
inherit (lib) mkOption types;
inherit (types)
deferredModule
submodule
functionTo
optionType
@ -13,10 +14,10 @@ in
{
options = {
input-type = mkOption {
type = optionType;
type = deferredModule;
};
output-type = mkOption {
type = optionType;
type = deferredModule;
};
function-type = mkOption {
type = optionType;
@ -25,10 +26,10 @@ in
submodule (function: {
options = {
input = mkOption {
type = config.input-type;
type = submodule config.input-type;
};
output = mkOption {
type = config.output-type;
type = submodule config.output-type;
};
};
})