smallest change
This commit is contained in:
parent
4cca1dc327
commit
9c83ba6849
77 changed files with 36828 additions and 1516 deletions
|
|
@ -15,7 +15,29 @@ in {
|
|||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
services.mullvad-vpn.enable = cfg.mullvad;
|
||||
services.mullvad-vpn = {
|
||||
enable = cfg.mullvad;
|
||||
package = nixos-stable.mullvad;
|
||||
};
|
||||
#
|
||||
# # Create a specific network namespace for VPN traffic
|
||||
# systemd.services.mullvad-daemon = {
|
||||
# serviceConfig = {
|
||||
# NetworkNamespacePath = "/run/netns/mullvad";
|
||||
# };
|
||||
# };
|
||||
#
|
||||
# # Configure transmission to use Mullvad's SOCKS5 proxy
|
||||
# # Configure transmission to use the Mullvad network namespace
|
||||
# systemd.services.transmission = mkIf config.services.transmission.enable {
|
||||
# serviceConfig = {
|
||||
# NetworkNamespacePath = "/run/netns/mullvad";
|
||||
# };
|
||||
# # Make sure Mullvad is running before transmission starts
|
||||
# requires = ["mullvad-daemon.service"];
|
||||
# after = ["mullvad-daemon.service"];
|
||||
# };
|
||||
|
||||
services.openvpn = {
|
||||
servers = {
|
||||
work = {
|
||||
|
|
@ -27,14 +49,21 @@ in {
|
|||
|
||||
systemd.services.openvpn-work.wantedBy = lib.mkForce [];
|
||||
|
||||
systemd.services."mullvad-daemon".postStart = let
|
||||
mullvad = config.services.mullvad-vpn.package;
|
||||
in
|
||||
mkIf cfg.mullvad ''
|
||||
while ! ${mullvad}/bin/mullvad status >/dev/null; do sleep 1; done
|
||||
${mullvad}/bin/mullvad auto-connect set on
|
||||
${mullvad}/bin/mullvad tunnel set ipv6 on
|
||||
${mullvad}/bin/mullvad connect
|
||||
'';
|
||||
# # Add necessary networking tools
|
||||
# environment.systemPackages = with pkgs; [
|
||||
# iproute2 # for ip netns commands
|
||||
# ];
|
||||
#
|
||||
# # Setup network namespace
|
||||
# systemd.services.setup-mullvad-netns = {
|
||||
# description = "Setup Mullvad Network Namespace";
|
||||
# before = ["mullvad-daemon.service"];
|
||||
# serviceConfig = {
|
||||
# Type = "oneshot";
|
||||
# RemainAfterExit = true;
|
||||
# ExecStart = "${pkgs.iproute2}/bin/ip netns add mullvad";
|
||||
# ExecStop = "${pkgs.iproute2}/bin/ip netns delete mullvad";
|
||||
# };
|
||||
# };
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue