-
Notifications
You must be signed in to change notification settings - Fork 59
feat(multiService): Add service option to modify underlying process settings #617
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
settings.processes will interfere with existing settings option in a service. See mysql's options for ex.
| default = "${service}.${name}"; | ||
| type = lib.types.str; | ||
| processSettings = lib.mkOption { | ||
| type = lib.types.lazyAttrsOf lib.types.deferredModule; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lazyAttrsOf because a service can define multiple processes (postgres, postgres-init for example)
nix/lib.nix
Outdated
| imports = [ | ||
| config.outputs.defaultProcessSettings | ||
| cfg | ||
| ] ++ lib.optional (lib.hasAttr pName config.processSettings) config.processSettings.${pName}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would silently fail on situations when the user sets settings for a non-existant process. So it is best to just discard the lib.hasAttr check here, because then evaluation fail when the user does that.
|
Needs to update the documentation as well (LLM is handy here) https://community.flake.parts/services-flake/custom-service#multi-instance |
resolves #616