1 { config, pkgs, lib, ... }:
8 enable = options.mkEnableOption "the v2rayA service";
12 config = mkIf config.services.v2raya.enable {
13 environment.systemPackages = [ pkgs.v2raya ];
15 systemd.services.v2raya =
17 nftablesEnabled = config.networking.nftables.enable;
20 ] ++ optional config.networking.enableIPv6 "ip6tables.service";
21 tableServices = if nftablesEnabled then [ "nftables.service" ] else iptablesServices;
25 Description = "v2rayA service";
26 Documentation = "https://github.com/v2rayA/v2rayA/wiki";
31 Wants = [ "network.target" ];
36 ExecStart = "${getExe pkgs.v2raya} --log-disable-timestamp";
37 Environment = [ "V2RAYA_LOG_FILE=/var/log/v2raya/v2raya.log" ];
39 LimitNOFILE = 1000000;
40 Restart = "on-failure";
44 wantedBy = [ "multi-user.target" ];
45 path = with pkgs; [ iptables bash iproute2 ] ++ lib.optionals nftablesEnabled [ nftables ]; # required by v2rayA TProxy functionality
49 meta.maintainers = with maintainers; [ elliot ];