mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-07-14 06:00:33 +03:00
Merge pull request #226514 from AtaraxiaSjel/update/ivpn
This commit is contained in:
commit
ce4159b4cd
5 changed files with 130 additions and 4 deletions
51
nixos/modules/services/networking/ivpn.nix
Normal file
51
nixos/modules/services/networking/ivpn.nix
Normal file
|
@ -0,0 +1,51 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
let
|
||||
cfg = config.services.ivpn;
|
||||
in
|
||||
with lib;
|
||||
{
|
||||
options.services.ivpn = {
|
||||
enable = mkOption {
|
||||
type = types.bool;
|
||||
default = false;
|
||||
description = lib.mdDoc ''
|
||||
This option enables iVPN daemon.
|
||||
This sets {option}`networking.firewall.checkReversePath` to "loose", which might be undesirable for security.
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
boot.kernelModules = [ "tun" ];
|
||||
|
||||
environment.systemPackages = with pkgs; [ ivpn ivpn-service ];
|
||||
|
||||
# iVPN writes to /etc/iproute2/rt_tables
|
||||
networking.iproute2.enable = true;
|
||||
networking.firewall.checkReversePath = "loose";
|
||||
|
||||
systemd.services.ivpn-service = {
|
||||
description = "iVPN daemon";
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
wants = [ "network.target" ];
|
||||
after = [
|
||||
"network-online.target"
|
||||
"NetworkManager.service"
|
||||
"systemd-resolved.service"
|
||||
];
|
||||
path = [
|
||||
# Needed for mount
|
||||
"/run/wrappers"
|
||||
];
|
||||
startLimitBurst = 5;
|
||||
startLimitIntervalSec = 20;
|
||||
serviceConfig = {
|
||||
ExecStart = "${pkgs.ivpn-service}/bin/ivpn-service --logging";
|
||||
Restart = "always";
|
||||
RestartSec = 1;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
meta.maintainers = with maintainers; [ ataraxiasjel ];
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue