mirror of
https://forgejo.altau.su/lego/lego-monitoring.git
synced 2026-03-10 04:41:10 +00:00
stub service
This commit is contained in:
parent
19984b43f4
commit
f158bc3778
6 changed files with 92 additions and 52 deletions
|
|
@ -1,14 +1,42 @@
|
|||
package:
|
||||
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
{
|
||||
options.services.lego-monitoring = {
|
||||
enable = lib.mkEnableOption "lego-monitoring service.";
|
||||
|
||||
nonSecretConfigOption = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "defaultValue";
|
||||
description = "An example non-secret config option.";
|
||||
};
|
||||
|
||||
configOptionSecretPath = lib.mkOption {
|
||||
type = lib.types.nullOr lib.types.str;
|
||||
default = null;
|
||||
description = "Path to an example secret config option.";
|
||||
};
|
||||
};
|
||||
|
||||
config = {};
|
||||
config = let
|
||||
cfg = config.services.lego-monitoring;
|
||||
json = pkgs.formats.json {};
|
||||
serviceConfigFile = json.generate "config.json" {
|
||||
non_secret_config_option = cfg.nonSecretConfigOption;
|
||||
config_option_secret_path = cfg.configOptionSecretPath;
|
||||
};
|
||||
in lib.mkIf cfg.enable {
|
||||
systemd.services.lego-monitoring = {
|
||||
name = "lego-monitoring.service";
|
||||
description = "Lego-monitoring service";
|
||||
script = "${package}/bin/service -c ${serviceConfigFile}";
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue