1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-20 12:42:24 +00:00

Merge pull request #70762 from xfix/nixos-mullvad-vpn

nixos/mullvad-vpn: add service
This commit is contained in:
Mario Rodas 2020-04-01 08:26:07 -05:00 committed by GitHub
commit c47ec3067d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 44 additions and 0 deletions

View file

@ -654,6 +654,7 @@
./services/networking/miredo.nix
./services/networking/mstpd.nix
./services/networking/mtprotoproxy.nix
./services/networking/mullvad-vpn.nix
./services/networking/murmur.nix
./services/networking/mxisd.nix
./services/networking/namecoind.nix

View file

@ -0,0 +1,43 @@
{ config, lib, pkgs, ... }:
let
cfg = config.services.mullvad-vpn;
in
with lib;
{
options.services.mullvad-vpn.enable = mkOption {
type = types.bool;
default = false;
description = ''
This option enables Mullvad VPN daemon.
'';
};
config = mkIf cfg.enable {
boot.kernelModules = [ "tun" ];
systemd.services.mullvad-daemon = {
description = "Mullvad VPN daemon";
wantedBy = [ "multi-user.target" ];
wants = [ "network.target" ];
after = [
"network-online.target"
"NetworkManager.service"
"systemd-resolved.service"
];
path = [
pkgs.iproute
# Needed for ping
"/run/wrappers"
];
serviceConfig = {
StartLimitBurst = 5;
StartLimitIntervalSec = 20;
ExecStart = "${pkgs.mullvad-vpn}/bin/mullvad-daemon -v --disable-stdout-timestamps";
Restart = "always";
RestartSec = 1;
};
};
};
meta.maintainers = [ maintainers.xfix ];
}