updates...

This commit is contained in:
zack 2024-09-21 18:49:15 -04:00
parent 24716c999a
commit d94793e019
No known key found for this signature in database
GPG key ID: 5F873416BCF59F35
10 changed files with 215 additions and 81 deletions

View file

@ -0,0 +1,49 @@
{
lib,
config,
pkgs,
...
}:
with lib;
with lib.custom; let
cfg = config.services.pm-bridge;
in {
options.services.pm-bridge = with types; {
enable = mkBoolOpt false "Enable Protonmail Bridge";
package = lib.mkPackageOption pkgs "protonmail-bridge" {};
logLevel = lib.mkOption {
type = lib.types.nullOr (
lib.types.enum [
"panic"
"fatal"
"error"
"warn"
"info"
"debug"
]
);
default = null;
description = "Log level of the Proton Mail Bridge service. If set to null then the service uses it's default log level.";
};
};
config = mkIf cfg.enable {
systemd.user.services.protonmail-bridge = {
Unit = {
Description = "A Bridge to view Protonmail Messages in your local email client";
};
Service = let
logLevel = lib.optionalString (cfg.logLevel != null) "--log-level ${cfg.logLevel}";
in {
Type = "simple";
ExecStart = "${lib.getExe cfg.package} --noninteractive ${logLevel}";
Restart = "always";
};
Install = {
WantedBy = ["graphical-session.target"];
};
};
};
}