forked from Fediversity/Fediversity
fix deployment evaluation
This commit is contained in:
parent
312ca7a48b
commit
0599a33916
2 changed files with 19 additions and 2 deletions
|
@ -14,6 +14,7 @@ let
|
|||
];
|
||||
}).config;
|
||||
nixops4Deployment = inputs.nixops4.modules.nixops4Deployment.default;
|
||||
inherit (inputs.nixops4.lib) mkDeployment;
|
||||
in
|
||||
{
|
||||
test-eval = {
|
||||
|
@ -166,6 +167,12 @@ in
|
|||
resources = fediversity.applications.hello.resources fediversity.example-configuration.applications.hello;
|
||||
hello-shell = (resources).resources.hello.login-shell;
|
||||
environment = fediversity.environments.single-nixos-vm.resources.operator-environment.login-shell;
|
||||
result = mkDeployment {
|
||||
modules = [
|
||||
(fediversity.environments.single-nixos-vm.deployment fediversity.example-configuration)
|
||||
];
|
||||
};
|
||||
|
||||
in
|
||||
rec {
|
||||
number-of-resources = with lib; length (attrNames fediversity.resources);
|
||||
|
@ -182,6 +189,12 @@ in
|
|||
packages = with lib; map (p: "${p.pname}") operator.packages;
|
||||
extraGroups = operator.extraGroups;
|
||||
};
|
||||
deployment = {
|
||||
inherit (result) _type;
|
||||
deploymentFunction = lib.isFunction result.deploymentFunction;
|
||||
# XXX(@fricklerhandwerk): evaluating the derivation takes a bit, we may want to stop at `isFunction` here
|
||||
getProviders = lib.isDerivation (result.getProviders { system = builtins.currentSystem; });
|
||||
};
|
||||
};
|
||||
expected = {
|
||||
number-of-resources = 2;
|
||||
|
@ -197,6 +210,11 @@ in
|
|||
packages = [ "hello" ];
|
||||
extraGroups = [ ];
|
||||
};
|
||||
deployment = {
|
||||
_type = "nixops4Deployment";
|
||||
deploymentFunction = true;
|
||||
getProviders = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
@ -10,7 +10,6 @@ let
|
|||
attrsOf
|
||||
attrTag
|
||||
deferredModuleWith
|
||||
submoduleWith
|
||||
submodule
|
||||
optionType
|
||||
functionTo
|
||||
|
@ -159,7 +158,7 @@ in
|
|||
};
|
||||
deployment = mkOption {
|
||||
description = "Generate a deployment from a configuration";
|
||||
type = functionTo (submodule environment.config.resource-mapping.output-type);
|
||||
type = functionTo (environment.config.resource-mapping.output-type);
|
||||
readOnly = true;
|
||||
default =
|
||||
cfg:
|
||||
|
|
Loading…
Add table
Reference in a new issue