1

Modules/Network: Remove wireguard configuration options

This commit is contained in:
2025-07-10 22:26:40 +02:00
parent da5d120efe
commit 257060a6c2
5 changed files with 2 additions and 147 deletions

View File

@ -44,38 +44,8 @@ in {
inherit (cfg) networks;
};
# Wireguard VPNs
systemd.services = mkIf (!cfg.useNetworkManager) cfg.wireguard-tunnels;
# NOTE: I can connect to TU Dortmund directly
# TODO: Use config with netns, like with wireguard
# services.openvpn.servers = {
# # TODO: Can't read config file...
# tu-dortmund-irb = {
# autoStart = false;
# config = "config ~/NixFlake/config/openvpn/tu-dortmund-irb.ovpn";
# };
# };
# TODO: Rewrite with lib.pipe
# Generate list of vpns for rofi menu
environment.etc."rofi-vpns" = let
names-list = attrNames cfg.wireguard-tunnels;
names = concatStringsSep "\n" names-list;
in
mkIf (!cfg.useNetworkManager) {text = names;};
# Allow to enable/disable tunnels without root password
modules.polkit.allowedSystemServices = let
vpn-services = lib.pipe cfg.wireguard-tunnels [
attrNames
(map (v: "${v}.service"))
];
in
mkIf (!cfg.useNetworkManager) vpn-services;
modules.polkit.allowedActions = mkIf cfg.useNetworkManager [
# NOTE: List permissions by running "nmcli general permissions"
# List NM permissions by running "nmcli general permissions"
"org.freedesktop.NetworkManager.settings.modify.system"
];

View File

@ -41,17 +41,6 @@ with mylib.modules; {
'';
};
wireguard-tunnels = mkOption {
type = types.attrs;
default = {};
description = "Wireguard VPN Tunnels";
example = ''
wg0-de-115 = {
[...]
};
'';
};
allowedTCPPorts = mkOption {
type = types.listOf types.int;
default = [];