mirror of
https://github.com/vale981/phoebe
synced 2025-03-04 17:31:41 -05:00
Add the ability for Rails apps to depend on configured services
The new `afterServices' setting allows a Rails app to depend on arbitrary systemd services.
This commit is contained in:
parent
c45f05c96c
commit
41475bbde5
2 changed files with 11 additions and 2 deletions
|
@ -186,6 +186,13 @@ let
|
|||
should really use the Rails secrets system.
|
||||
'';
|
||||
};
|
||||
|
||||
afterServices = mkOption {
|
||||
type = types.listOf types.str;
|
||||
default = [ ];
|
||||
example = [ "foo-key.service" ];
|
||||
description = "Additional services to start before Rails.";
|
||||
};
|
||||
};
|
||||
|
||||
config = {
|
||||
|
|
|
@ -39,7 +39,8 @@ let
|
|||
|
||||
wants =
|
||||
plib.keyService app.database.passwordFile ++
|
||||
plib.keyService app.sourcedFile;
|
||||
plib.keyService app.sourcedFile ++
|
||||
app.afterServices;
|
||||
|
||||
after =
|
||||
[ "network.target" ] ++
|
||||
|
@ -47,7 +48,8 @@ let
|
|||
optional funcs.localpg "pg-accounts.service" ++
|
||||
optional (!service.isMain) "rails-${app.name}-main" ++
|
||||
plib.keyService app.database.passwordFile ++
|
||||
plib.keyService app.sourcedFile;
|
||||
plib.keyService app.sourcedFile ++
|
||||
app.afterServices;
|
||||
|
||||
preStart = optionalString service.isMain ''
|
||||
# Prepare the config directory:
|
||||
|
|
Loading…
Add table
Reference in a new issue