Mullvad VPN: Difference between revisions

Added autostart configuration, formatted configuration.nix files.
Update for https://github.com/NixOS/nixpkgs/pull/414831
 
(6 intermediate revisions by 3 users not shown)
Line 3: Line 3:
== Installation ==
== Installation ==


To install Mullvad VPN, you need to enable it in your system options:
To install Mullvad VPN, simply enable the service in the system configuration:
 
{{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|configuration.nix|nix|<nowiki>
{{file|configuration.nix|nix|<nowiki>
Line 13: Line 11:
</nowiki>}}
</nowiki>}}


If you want to use the GUI application:
The GUI application may be enabled in addition to the main Mullvad service:


{{file|configuration.nix|nix|<nowiki>
{{file|configuration.nix|nix|<nowiki>
{ pkgs, ... }:
{ pkgs, ... }:
{
{
   services.mullvad-vpn.package = pkgs.mullvad-vpn;
   services.mullvad-vpn.gui.enable = true;
}
}
</nowiki>}}
</nowiki>}}
Line 126: Line 124:
               "ua"
               "ua"
             ];
             ];
             africa = [ "za" ];
             africa = [
              "ng"
              "za"
            ];
             asia = [
             asia = [
               "hk"
               "hk"
Line 132: Line 133:
               "il"
               "il"
               "jp"
               "jp"
              "my"
              "ph"
               "sg"
               "sg"
               "th"
               "th"
Line 156: Line 159:
           /*
           /*
             {
             {
               hostname= "se-sto-wg-001";
               hostname = "se-sto-wg-001";
               ipv4_addr_in= "<remote IPv4>";
               ipv4_addr_in = "[remote IPv4]";
               ipv6_addr_in= "<remote IPv6>";
               ipv6_addr_in = "[remote IPv6]";
             }
             }
           */
           */
Line 232: Line 235:
=== Autostarting the GUI application ===
=== 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>:
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>
{{file|configuration.nix|nix|<nowiki>
Line 247: Line 250:
</nowiki>}}
</nowiki>}}


[[Category:Applications]]
This is useful when the home directory is [[Impermanence|stateless]], as the file configured by Mullvad would not be persistent.
 
[[Category:VPN]]
[[Category:Networking]]