forked from DGNum/infrastructure
feat(django-apps): Add timers option
This is similar to extraServices but without the partOf, upheldBy and wantedBy settings.
This commit is contained in:
parent
80ede4b1f6
commit
09ffafade0
1 changed files with 31 additions and 0 deletions
|
@ -322,6 +322,15 @@ in
|
|||
Extra services to run in parallel of the application.
|
||||
May be used to run background tasks and/or workers.
|
||||
'';
|
||||
|
||||
timers = mkOption {
|
||||
type = attrs;
|
||||
default = { };
|
||||
description = ''
|
||||
Extra oneshot services to run in parallel of the application.
|
||||
Be aware that `startAt` should be included.
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
manageScript = mkOption {
|
||||
|
@ -805,6 +814,28 @@ in
|
|||
} serviceContent
|
||||
)
|
||||
) config.extraServices)
|
||||
// (mapAttrs' (
|
||||
serviceName: serviceContent:
|
||||
nameValuePair "dj-${name}_${serviceName}" (
|
||||
recursiveUpdate {
|
||||
inherit after environment path;
|
||||
|
||||
serviceConfig = {
|
||||
inherit
|
||||
Group
|
||||
LoadCredential
|
||||
RuntimeDirectory
|
||||
StateDirectory
|
||||
UMask
|
||||
User
|
||||
;
|
||||
|
||||
WorkingDirectory = "/var/lib/django-apps/${name}/source";
|
||||
DynamicUser = true;
|
||||
};
|
||||
} serviceContent
|
||||
)
|
||||
) config.timers)
|
||||
) cfg.sites);
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue