niksos/hosts/niks/mullvad.nix

25 lines
689 B
Nix
Raw Normal View History

2023-07-20 13:15:20 +02:00
{
config,
pkgs,
...
}: {
2023-07-20 13:41:31 +02:00
environment.systemPackages = with pkgs; [ mullvad-vpn mullvad ];
2023-07-20 13:55:22 +02:00
networking.wireguard.enable = true;
2023-07-20 17:03:27 +02:00
networking.iproute2.enable = true;
2023-07-20 13:55:22 +02:00
2023-07-20 13:41:31 +02:00
services.mullvad-vpn = {
enable = true;
2023-07-30 00:52:01 +02:00
package = pkgs.mullvad-vpn;
2023-07-20 13:41:31 +02:00
};
2023-07-20 13:15:20 +02:00
systemd.services."mullvad-daemon".postStart = let
mullvad = config.services.mullvad-vpn.package;
in ''
while ! ${mullvad}/bin/mullvad status > /dev/null; do sleep 1; done
${mullvad}/bin/mullvad auto-connect set on
${mullvad}/bin/mullvad tunnel ipv6 set on
${mullvad}/bin/mullvad set default --block-ads --block-trackers --block-malware
'';
}