Mullvad VPN: Difference between revisions
Added example of a declarative mullvad configuration and formatted page. |
Added autostart configuration, formatted configuration.nix files. |
||
Line 7: | Line 7: | ||
{{warning|1=Mullvad VPN currently only works if [[systemd-resolved]] is enable. More info [https://discourse.nixos.org/t/connected-to-mullvadvpn-but-no-internet-connection/35803/8?u=lion at this forum post]. If this issue is fixed please remove this warning banner.}} | {{warning|1=Mullvad VPN currently only works if [[systemd-resolved]] is enable. More info [https://discourse.nixos.org/t/connected-to-mullvadvpn-but-no-internet-connection/35803/8?u=lion at this forum post]. If this issue is fixed please remove this warning banner.}} | ||
{{file| | {{file|configuration.nix|nix|<nowiki> | ||
services.mullvad-vpn.enable = true; | { | ||
services.mullvad-vpn.enable = true; | |||
} | |||
</nowiki>}} | </nowiki>}} | ||
If you want to use the GUI application: | If you want to use the GUI application: | ||
< | {{file|configuration.nix|nix|<nowiki> | ||
services.mullvad-vpn.package = pkgs.mullvad-vpn; | { pkgs, ... }: | ||
</ | { | ||
services.mullvad-vpn.package = pkgs.mullvad-vpn; | |||
} | |||
</nowiki>}} | |||
{{Evaluate}} | {{Evaluate}} | ||
Line 223: | Line 228: | ||
} | } | ||
</nowiki>}} | |||
=== Autostarting the GUI application === | |||
If you don't want to rely on Mullvad's autostart file in <code>~/.config/autostart</code>, (Perhaps because your configuration is [[Impermanence|stateless]]) 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>}} | </nowiki>}} | ||
[[Category:Applications]] | [[Category:Applications]] |