diff --git a/modules/nixos/services/wireguard/default.nix b/modules/nixos/services/wireguard/default.nix index 26e54e0..6c0ef91 100644 --- a/modules/nixos/services/wireguard/default.nix +++ b/modules/nixos/services/wireguard/default.nix @@ -100,8 +100,6 @@ in options.my.services.wireguard = with lib; { enable = mkEnableOption "Wireguard VPN service"; - simpleManagement = my.mkDisableOption "manage units without password prompts"; - startAtBoot = mkEnableOption '' Should the VPN service be started at boot. Must be true for the server to work reliably. @@ -266,33 +264,8 @@ in # Make systemd shut down one service when starting the other (lib.mkIf (cfg.internal.enable) { - systemd.services."wg-quick-${cfg.iface}" = { - conflicts = [ "wg-quick-${cfg.internal.name}.service" ]; - after = [ "wg-quick-${cfg.internal.name}.service" ]; - }; - systemd.services."wg-quick-${cfg.internal.name}" = { - conflicts = [ "wg-quick-${cfg.iface}.service" ]; - after = [ "wg-quick-${cfg.iface}.service" ]; - }; - }) - - # Make it possible to manage those units without using passwords, for admins - (lib.mkIf cfg.simpleManagement { - environment.etc."polkit-1/rules.d/50-wg-quick.rules".text = '' - polkit.addRule(function(action, subject) { - if (action.id == "org.freedesktop.systemd1.manage-units") { - var unit = action.lookup("unit") - if (unit == "wg-quick-${cfg.iface}.service" || unit == "wg-quick-${cfg.internal.name}.service") { - var verb = action.lookup("verb"); - if (verb == "start" || verb == "stop" || verb == "restart") { - if (subject.isInGroup("wheel")) { - return polkit.Result.YES; - } - } - } - } - }); - ''; + systemd.services."wg-quick-${cfg.iface}".conflicts = [ "wg-quick-${cfg.internal.name}.service" ]; + systemd.services."wg-quick-${cfg.internal.name}".conflicts = [ "wg-quick-${cfg.iface}.service" ]; }) ]); } diff --git a/modules/nixos/system/default.nix b/modules/nixos/system/default.nix index e6fb25b..e7a4dd3 100644 --- a/modules/nixos/system/default.nix +++ b/modules/nixos/system/default.nix @@ -10,7 +10,6 @@ ./nix ./packages ./podman - ./polkit ./printing ./users ]; diff --git a/modules/nixos/system/polkit/default.nix b/modules/nixos/system/polkit/default.nix deleted file mode 100644 index 1e5b573..0000000 --- a/modules/nixos/system/polkit/default.nix +++ /dev/null @@ -1,16 +0,0 @@ -# Polkit settings -{ config, lib, ... }: -let - cfg = config.my.system.polkit; -in -{ - options.my.system.polkit = with lib; { - enable = my.mkDisableOption "polkit configuration"; - }; - - config = lib.mkIf cfg.enable { - security.polkit = { - enable = true; - }; - }; -}