forked from fediversity/fediversity
fix data model
Signed-off-by: Kiara Grouwstra <kiara@procolix.eu>
This commit is contained in:
parent
502cbe8d6d
commit
0560135cee
2 changed files with 24 additions and 18 deletions
|
|
@ -105,8 +105,7 @@ let
|
||||||
options.enable = lib.mkEnableOption "Hello in the shell";
|
options.enable = lib.mkEnableOption "Hello in the shell";
|
||||||
};
|
};
|
||||||
implementation = cfg: {
|
implementation = cfg: {
|
||||||
input = cfg;
|
resources = lib.optionalAttrs cfg.enable {
|
||||||
output.resources = lib.optionalAttrs cfg.enable {
|
|
||||||
hello.login-shell.packages.hello = pkgs.hello;
|
hello.login-shell.packages.hello = pkgs.hello;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
@ -142,8 +141,7 @@ let
|
||||||
deployment-name,
|
deployment-name,
|
||||||
}:
|
}:
|
||||||
{
|
{
|
||||||
input = required-resources;
|
ssh-host = {
|
||||||
output.ssh-host = {
|
|
||||||
nixos-configuration = mkNixosConfiguration environment required-resources;
|
nixos-configuration = mkNixosConfiguration environment required-resources;
|
||||||
system = targetSystem;
|
system = targetSystem;
|
||||||
ssh = {
|
ssh = {
|
||||||
|
|
@ -166,8 +164,7 @@ let
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
{
|
{
|
||||||
input = required-resources;
|
nixops4 =
|
||||||
output.nixops4 =
|
|
||||||
{ providers, ... }:
|
{ providers, ... }:
|
||||||
{
|
{
|
||||||
providers = {
|
providers = {
|
||||||
|
|
|
||||||
|
|
@ -286,22 +286,31 @@ in
|
||||||
};
|
};
|
||||||
config-mapping = mkOption {
|
config-mapping = mkOption {
|
||||||
description = "Mapping from a configuration to a deployment";
|
description = "Mapping from a configuration to a deployment";
|
||||||
type = submodule functionType;
|
type = functionType;
|
||||||
readOnly = true;
|
readOnly = true;
|
||||||
default = {
|
default = {
|
||||||
input-type = config.configuration;
|
input-type = submodule {
|
||||||
|
options = {
|
||||||
|
deployment-name = mkOption {
|
||||||
|
type = types.str;
|
||||||
|
};
|
||||||
|
configuration = mkOption {
|
||||||
|
type = config.configuration;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
output-type = deployment-type;
|
output-type = deployment-type;
|
||||||
implementation =
|
implementation =
|
||||||
{
|
{
|
||||||
deployment-name,
|
deployment-name,
|
||||||
configuration,
|
configuration,
|
||||||
}:
|
}:
|
||||||
# TODO: check cfg.enable.true
|
# TODO: check cfg.enable.true
|
||||||
let
|
let
|
||||||
required-resources = lib.mapAttrs (
|
required-resources = lib.mapAttrs (
|
||||||
name: application-settings: config.applications.${name}.resources application-settings
|
name: application-settings: config.applications.${name}.resources application-settings
|
||||||
) configuration.applications;
|
) configuration.applications;
|
||||||
in
|
in
|
||||||
environment.config.resource-mapping.apply { inherit required-resources deployment-name; };
|
environment.config.resource-mapping.apply { inherit required-resources deployment-name; };
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue