Compare commits

..

1 commit

3 changed files with 16 additions and 9 deletions

View file

@ -93,8 +93,8 @@ let
};
implementation = cfg: {
input = cfg;
output = lib.optionalAttrs cfg.enable {
resources.hello.login-shell.packages.hello = pkgs.hello;
output.resources = lib.optionalAttrs cfg.enable {
hello.login-shell.packages.hello = pkgs.hello;
};
};
};
@ -126,7 +126,11 @@ let
null;
users.users = environment.config.resources."operator-environment".login-shell.apply {
resources = lib.filterAttrs (_name: value: value ? login-shell) requests;
resources = lib.filterAttrs (_name: value: value ? login-shell) (
lib.concatMapAttrs (
k': req: lib.mapAttrs' (k: lib.nameValuePair "${k'}.${k}") req.resources
) requests
);
};
};
};

View file

@ -100,8 +100,8 @@ in
};
implementation = cfg: {
input = cfg;
output = lib.optionalAttrs cfg.enable {
resources.hello.login-shell.packages.hello = pkgs.hello;
output.resources = lib.optionalAttrs cfg.enable {
hello.login-shell.packages.hello = pkgs.hello;
};
};
};
@ -126,7 +126,11 @@ in
{ ... }:
{
users.users = config.resources."operator-environment".login-shell.apply {
resources = lib.filterAttrs (_name: value: value ? login-shell) requests;
resources = lib.filterAttrs (_name: value: value ? login-shell) (
lib.concatMapAttrs (
k': req: lib.mapAttrs' (k: lib.nameValuePair "${k'}.${k}") req.resources
) requests
);
};
};
};

View file

@ -93,8 +93,7 @@ in
description = "The type of resource this policy configures";
type = types.optionType;
};
# TODO(@fricklerhandwerk): we may want to make the function type explict here: `request -> resource-type`
# and then also rename this to be consistent with the application's resource mapping
# TODO(@fricklerhandwerk): we may want to make the function type explicit here: `application-resources -> resource-type`
options.apply = mkOption {
description = "Apply the policy to a request";
type = functionTo policy.config.resource-type;
@ -174,7 +173,7 @@ in
type = submodule functionType;
readOnly = true;
default = {
input-type = application-resources;
input-type = attrsOf application-resources;
output-type = deployment-type;
};
};