mirror of
https://github.com/juspay/services-flake.git
synced 2024-08-14 23:00:41 +03:00
refactor(fmt): group outputs options
This commit is contained in:
parent
a6ec8b3f61
commit
7200b458b5
42
nix/lib.nix
42
nix/lib.nix
@ -28,27 +28,29 @@
|
||||
default = "${service}.${name}";
|
||||
type = lib.types.str;
|
||||
};
|
||||
outputs.defaultProcessSettings = lib.mkOption {
|
||||
type = lib.types.deferredModule;
|
||||
internal = true;
|
||||
readOnly = true;
|
||||
description = ''
|
||||
Default settings for all processes under the ${service} service
|
||||
'';
|
||||
default = {
|
||||
namespace = lib.mkDefault config.namespace;
|
||||
outputs = {
|
||||
defaultProcessSettings = lib.mkOption {
|
||||
type = lib.types.deferredModule;
|
||||
internal = true;
|
||||
readOnly = true;
|
||||
description = ''
|
||||
Default settings for all processes under the ${service} service
|
||||
'';
|
||||
default = {
|
||||
namespace = lib.mkDefault config.namespace;
|
||||
};
|
||||
};
|
||||
};
|
||||
outputs.settings = lib.mkOption {
|
||||
type = lib.types.lazyAttrsOf lib.types.raw;
|
||||
internal = true;
|
||||
description = ''
|
||||
process-compose settings for the processes under the ${service} service
|
||||
'';
|
||||
apply = v: v // {
|
||||
processes = lib.flip lib.mapAttrs v.processes (_: cfg:
|
||||
{ imports = [ config.outputs.defaultProcessSettings cfg ]; }
|
||||
);
|
||||
settings = lib.mkOption {
|
||||
type = lib.types.lazyAttrsOf lib.types.raw;
|
||||
internal = true;
|
||||
description = ''
|
||||
process-compose settings for the processes under the ${service} service
|
||||
'';
|
||||
apply = v: v // {
|
||||
processes = lib.flip lib.mapAttrs v.processes (_: cfg:
|
||||
{ imports = [ config.outputs.defaultProcessSettings cfg ]; }
|
||||
);
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user