32 lines
687 B
Nix
32 lines
687 B
Nix
{ config, lib, pkgs, ... }:
|
|
|
|
with lib;
|
|
|
|
let cfg = config.services.protonmail-bridge;
|
|
in {
|
|
options = {
|
|
services.protonmail-bridge = {
|
|
enable = mkEnableOption "protonmail-bridge";
|
|
};
|
|
};
|
|
|
|
config = mkIf cfg.enable {
|
|
home.packages = [ pkgs.protonmail-bridge ];
|
|
|
|
systemd.user.services = {
|
|
protonmail-bridge = {
|
|
Unit = {
|
|
Description = "ProtonMail bridge";
|
|
After = "network.target";
|
|
};
|
|
Service = {
|
|
ExecStart =
|
|
"${pkgs.protonmail-bridge}/bin/protonmail-bridge --noninteractive";
|
|
Restart = "on-failure";
|
|
};
|
|
Install.WantedBy = [ "default.target" ];
|
|
};
|
|
};
|
|
};
|
|
}
|