9 cfg = config.services.protonmail-bridge;
12 options.services.protonmail-bridge = {
13 enable = lib.mkEnableOption "protonmail bridge";
15 package = lib.mkPackageOption pkgs "protonmail-bridge" { };
18 type = lib.types.listOf lib.types.path;
20 example = lib.literalExpression "with pkgs; [ pass gnome-keyring ]";
21 description = "List of derivations to put in protonmail-bride's path.";
24 logLevel = lib.mkOption {
25 type = lib.types.nullOr (
36 description = "Log level of the Proton Mail Bridge service. If set to null then the service uses it's default log level.";
40 config = lib.mkIf cfg.enable {
41 systemd.user.services.protonmail-bridge = {
42 description = "protonmail bridge";
43 wantedBy = [ "graphical-session.target" ];
44 after = [ "graphical-session.target" ];
48 logLevel = lib.optionalString (cfg.logLevel != null) "--log-level ${cfg.logLevel}";
51 ExecStart = "${lib.getExe cfg.package} --noninteractive ${logLevel}";
57 environment.systemPackages = [ cfg.package ];
59 meta.maintainers = with lib.maintainers; [ mzacho ];