mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-03 20:33:21 +00:00
6afb255d97
these changes were generated with nixq 0.0.2, by running nixq ">> lib.mdDoc[remove] Argument[keep]" --batchmode nixos/**.nix nixq ">> mdDoc[remove] Argument[keep]" --batchmode nixos/**.nix nixq ">> Inherit >> mdDoc[remove]" --batchmode nixos/**.nix two mentions of the mdDoc function remain in nixos/, both of which are inside of comments. Since lib.mdDoc is already defined as just id, this commit is a no-op as far as Nix (and the built manual) is concerned.
52 lines
1.3 KiB
Nix
52 lines
1.3 KiB
Nix
{ config, lib, pkgs, ... }:
|
|
let
|
|
cfg = config.services.ivpn;
|
|
in
|
|
with lib;
|
|
{
|
|
options.services.ivpn = {
|
|
enable = mkOption {
|
|
type = types.bool;
|
|
default = false;
|
|
description = ''
|
|
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" "network-online.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 ];
|
|
}
|