forked from Fediversity/Fediversity
Compare commits
1 commit
3fa1756feb
...
42ee27f737
Author | SHA1 | Date | |
---|---|---|---|
42ee27f737 |
3 changed files with 9 additions and 16 deletions
|
@ -93,8 +93,8 @@ let
|
||||||
};
|
};
|
||||||
implementation = cfg: {
|
implementation = cfg: {
|
||||||
input = cfg;
|
input = cfg;
|
||||||
output.resources = lib.optionalAttrs cfg.enable {
|
output = lib.optionalAttrs cfg.enable {
|
||||||
hello.login-shell.packages.hello = pkgs.hello;
|
resources.hello.login-shell.packages.hello = pkgs.hello;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
@ -126,11 +126,7 @@ let
|
||||||
null;
|
null;
|
||||||
|
|
||||||
users.users = environment.config.resources."operator-environment".login-shell.apply {
|
users.users = environment.config.resources."operator-environment".login-shell.apply {
|
||||||
resources = lib.filterAttrs (_name: value: value ? login-shell) (
|
resources = lib.filterAttrs (_name: value: value ? login-shell) requests;
|
||||||
lib.concatMapAttrs (
|
|
||||||
k': req: lib.mapAttrs' (k: lib.nameValuePair "${k'}.${k}") req.resources
|
|
||||||
) requests
|
|
||||||
);
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -100,8 +100,8 @@ in
|
||||||
};
|
};
|
||||||
implementation = cfg: {
|
implementation = cfg: {
|
||||||
input = cfg;
|
input = cfg;
|
||||||
output.resources = lib.optionalAttrs cfg.enable {
|
output = lib.optionalAttrs cfg.enable {
|
||||||
hello.login-shell.packages.hello = pkgs.hello;
|
resources.hello.login-shell.packages.hello = pkgs.hello;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
@ -126,11 +126,7 @@ in
|
||||||
{ ... }:
|
{ ... }:
|
||||||
{
|
{
|
||||||
users.users = config.resources."operator-environment".login-shell.apply {
|
users.users = config.resources."operator-environment".login-shell.apply {
|
||||||
resources = lib.filterAttrs (_name: value: value ? login-shell) (
|
resources = lib.filterAttrs (_name: value: value ? login-shell) requests;
|
||||||
lib.concatMapAttrs (
|
|
||||||
k': req: lib.mapAttrs' (k: lib.nameValuePair "${k'}.${k}") req.resources
|
|
||||||
) requests
|
|
||||||
);
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -93,7 +93,8 @@ in
|
||||||
description = "The type of resource this policy configures";
|
description = "The type of resource this policy configures";
|
||||||
type = types.optionType;
|
type = types.optionType;
|
||||||
};
|
};
|
||||||
# TODO(@fricklerhandwerk): we may want to make the function type explicit here: `application-resources -> resource-type`
|
# 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
|
||||||
options.apply = mkOption {
|
options.apply = mkOption {
|
||||||
description = "Apply the policy to a request";
|
description = "Apply the policy to a request";
|
||||||
type = functionTo policy.config.resource-type;
|
type = functionTo policy.config.resource-type;
|
||||||
|
@ -173,7 +174,7 @@ in
|
||||||
type = submodule functionType;
|
type = submodule functionType;
|
||||||
readOnly = true;
|
readOnly = true;
|
||||||
default = {
|
default = {
|
||||||
input-type = attrsOf application-resources;
|
input-type = application-resources;
|
||||||
output-type = deployment-type;
|
output-type = deployment-type;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Reference in a new issue