Mullvad VPN: Difference between revisions
Added example of a declarative mullvad configuration and formatted page. |
Update for https://github.com/NixOS/nixpkgs/pull/414831 |
||
| (7 intermediate revisions by 3 users not shown) | |||
| Line 3: | Line 3: | ||
== Installation == | == Installation == | ||
To install Mullvad VPN, | To install Mullvad VPN, simply enable the service in the system configuration: | ||
{{file|configuration.nix|nix|<nowiki> | |||
{ | |||
{{file| | services.mullvad-vpn.enable = true; | ||
services.mullvad-vpn.enable = true; | } | ||
</nowiki>}} | </nowiki>}} | ||
The GUI application may be enabled in addition to the main Mullvad service: | |||
< | {{file|configuration.nix|nix|<nowiki> | ||
services.mullvad-vpn. | { pkgs, ... }: | ||
</ | { | ||
services.mullvad-vpn.gui.enable = true; | |||
} | |||
</nowiki>}} | |||
{{Evaluate}} | {{Evaluate}} | ||
| Line 121: | Line 124: | ||
"ua" | "ua" | ||
]; | ]; | ||
africa = [ "za" ]; | africa = [ | ||
"ng" | |||
"za" | |||
]; | |||
asia = [ | asia = [ | ||
"hk" | "hk" | ||
| Line 127: | Line 133: | ||
"il" | "il" | ||
"jp" | "jp" | ||
"my" | |||
"ph" | |||
"sg" | "sg" | ||
"th" | "th" | ||
| Line 151: | Line 159: | ||
/* | /* | ||
{ | { | ||
hostname= "se-sto-wg-001"; | hostname = "se-sto-wg-001"; | ||
ipv4_addr_in= " | ipv4_addr_in = "[remote IPv4]"; | ||
ipv6_addr_in= " | ipv6_addr_in = "[remote IPv6]"; | ||
} | } | ||
*/ | */ | ||
| Line 225: | Line 233: | ||
</nowiki>}} | </nowiki>}} | ||
[[Category: | === Autostarting the GUI application === | ||
If you don't want to rely on Mullvad's autostart file in <code>~/.config/autostart</code>, you can set up an autostart file with <code>makeAutostartItem</code>: | |||
{{file|configuration.nix|nix|<nowiki> | |||
{ pkgs, ... }: | |||
let | |||
mullvad-autostart = pkgs.makeAutostartItem { | |||
name = "mullvad-vpn"; | |||
package = pkgs.mullvad-vpn; | |||
}; | |||
in | |||
{ | |||
environment.systemPackages = [ mullvad-autostart ]; | |||
} | |||
</nowiki>}} | |||
This is useful when the home directory is [[Impermanence|stateless]], as the file configured by Mullvad would not be persistent. | |||
[[Category:VPN]] | |||
[[Category:Networking]] | |||