1{ config, lib, pkgs, ... }:
2
3with lib;
4{
5 options.services.expressvpn.enable = mkOption {
6 type = types.bool;
7 default = false;
8 description = lib.mdDoc ''
9 Enable the ExpressVPN daemon.
10 '';
11 };
12
13 config = mkIf config.services.expressvpn.enable {
14 boot.kernelModules = [ "tun" ];
15
16 systemd.services.expressvpn = {
17 description = "ExpressVPN Daemon";
18 serviceConfig = {
19 ExecStart = "${pkgs.expressvpn}/bin/expressvpnd";
20 Restart = "on-failure";
21 RestartSec = 5;
22 };
23 wantedBy = [ "multi-user.target" ];
24 after = [ "network.target" "network-online.target" ];
25 };
26 };
27
28 meta.maintainers = with maintainers; [ yureien ];
29}