lol

v2raya: v2rayA should start after nftables

Elliot e78f2115 42f462e3

+30 -19
+30 -19
nixos/modules/services/networking/v2raya.nix
··· 12 12 config = mkIf config.services.v2raya.enable { 13 13 environment.systemPackages = [ pkgs.v2raya ]; 14 14 15 - systemd.services.v2raya = { 16 - unitConfig = { 17 - Description = "v2rayA service"; 18 - Documentation = "https://github.com/v2rayA/v2rayA/wiki"; 19 - After = [ "network.target" "nss-lookup.target" "iptables.service" "ip6tables.service" ]; 20 - Wants = [ "network.target" ]; 21 - }; 15 + systemd.services.v2raya = 16 + let 17 + nftablesEnabled = config.networking.nftables.enable; 18 + iptablesServices = [ 19 + "iptables.service" 20 + ] ++ optional config.networking.enableIPv6 "ip6tables.service"; 21 + tableServices = if nftablesEnabled then [ "nftables.service" ] else iptablesServices; 22 + in 23 + { 24 + unitConfig = { 25 + Description = "v2rayA service"; 26 + Documentation = "https://github.com/v2rayA/v2rayA/wiki"; 27 + After = [ 28 + "network.target" 29 + "nss-lookup.target" 30 + ] ++ tableServices; 31 + Wants = [ "network.target" ]; 32 + }; 33 + 34 + serviceConfig = { 35 + User = "root"; 36 + ExecStart = "${getExe pkgs.v2raya} --log-disable-timestamp"; 37 + Environment = [ "V2RAYA_LOG_FILE=/var/log/v2raya/v2raya.log" ]; 38 + LimitNPROC = 500; 39 + LimitNOFILE = 1000000; 40 + Restart = "on-failure"; 41 + Type = "simple"; 42 + }; 22 43 23 - serviceConfig = { 24 - User = "root"; 25 - ExecStart = "${getExe pkgs.v2raya} --log-disable-timestamp"; 26 - Environment = [ "V2RAYA_LOG_FILE=/var/log/v2raya/v2raya.log" ]; 27 - LimitNPROC = 500; 28 - LimitNOFILE = 1000000; 29 - Restart = "on-failure"; 30 - Type = "simple"; 44 + wantedBy = [ "multi-user.target" ]; 45 + path = with pkgs; [ iptables bash iproute2 ]; # required by v2rayA TProxy functionality 31 46 }; 32 - 33 - wantedBy = [ "multi-user.target" ]; 34 - path = with pkgs; [ iptables bash iproute2 ]; # required by v2rayA TProxy functionality 35 - }; 36 47 }; 37 48 38 49 meta.maintainers = with maintainers; [ elliot ];