Use polkit module for vpn services
This commit is contained in:
@ -18,11 +18,7 @@ in {
|
|||||||
# TODO: Don't hardcode subject.user == "christoph"
|
# TODO: Don't hardcode subject.user == "christoph"
|
||||||
security.polkit.extraConfig = let
|
security.polkit.extraConfig = let
|
||||||
# Stuff that is non-negotiable
|
# Stuff that is non-negotiable
|
||||||
always-predicates = [
|
always-predicates = [];
|
||||||
# TODO: Those should be set by the VPN/networkd module
|
|
||||||
"wg0-de-115.service"
|
|
||||||
"wg0-lu-16.service"
|
|
||||||
];
|
|
||||||
|
|
||||||
mkServicePredicate = service: "action.lookup(\"unit\") == \"${service}\"";
|
mkServicePredicate = service: "action.lookup(\"unit\") == \"${service}\"";
|
||||||
predicates = lib.pipe (cfg.allowed-system-services ++ always-predicates) [
|
predicates = lib.pipe (cfg.allowed-system-services ++ always-predicates) [
|
||||||
|
@ -34,6 +34,14 @@ in {
|
|||||||
in
|
in
|
||||||
names;
|
names;
|
||||||
|
|
||||||
|
modules.polkit.allowed-system-services = let
|
||||||
|
vpn-services = lib.pipe cfg.wireguard-tunnels [
|
||||||
|
attrNames
|
||||||
|
(map (v: "${v}.service"))
|
||||||
|
];
|
||||||
|
in
|
||||||
|
vpn-services;
|
||||||
|
|
||||||
# General Networking Settings
|
# General Networking Settings
|
||||||
networking = {
|
networking = {
|
||||||
# Gets inherited from flake in nixos mylib and passed through the module option
|
# Gets inherited from flake in nixos mylib and passed through the module option
|
||||||
|
Reference in New Issue
Block a user