mirror of
https://git.pvv.ntnu.no/Drift/pvv-nixos-config.git
synced 2026-01-19 09:29:13 +01:00
base/polkit: default to username if in group wheel
This commit is contained in:
@@ -24,6 +24,7 @@
|
||||
./services/logrotate.nix
|
||||
./services/nginx.nix
|
||||
./services/openssh.nix
|
||||
./services/polkit.nix
|
||||
./services/postfix.nix
|
||||
./services/prometheus-node-exporter.nix
|
||||
./services/prometheus-systemd-exporter.nix
|
||||
|
||||
15
base/services/polkit.nix
Normal file
15
base/services/polkit.nix
Normal file
@@ -0,0 +1,15 @@
|
||||
{ config, lib, ... }:
|
||||
let
|
||||
cfg = config.security.polkit;
|
||||
in
|
||||
{
|
||||
security.polkit.enable = true;
|
||||
|
||||
environment.etc."polkit-1/rules.d/9-nixos-overrides.rules".text = lib.mkIf cfg.enable ''
|
||||
polkit.addAdminRule(function(action, subject) {
|
||||
if(subject.isInGroup("wheel")) {
|
||||
return ["unix-user:"+subject.user];
|
||||
}
|
||||
});
|
||||
'';
|
||||
}
|
||||
Reference in New Issue
Block a user