Compare commits

...

2 Commits

Author SHA1 Message Date
h7x4
3a0ea9c338 base/polkit: default to username if in group wheel 2026-01-17 03:59:55 +09:00
h7x4
d66aab1e61 flake.lock: bump minecraft-kartverket 2026-01-17 03:59:29 +09:00
3 changed files with 20 additions and 4 deletions

View File

@@ -24,6 +24,7 @@
./services/logrotate.nix ./services/logrotate.nix
./services/nginx.nix ./services/nginx.nix
./services/openssh.nix ./services/openssh.nix
./services/polkit.nix
./services/postfix.nix ./services/postfix.nix
./services/prometheus-node-exporter.nix ./services/prometheus-node-exporter.nix
./services/prometheus-systemd-exporter.nix ./services/prometheus-systemd-exporter.nix

15
base/services/polkit.nix Normal file
View 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];
}
});
'';
}

8
flake.lock generated
View File

@@ -192,11 +192,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1768560570, "lastModified": 1768589887,
"narHash": "sha256-xWWz+bRfJZP4G9At5jxoPGc+6fSjbMmSuXeYd4WSPkU=", "narHash": "sha256-I5dIvg8BlytWngsqaA4t6/erfcy9zFCeETF1T0AXYPc=",
"ref": "main", "ref": "main",
"rev": "3bc8867f0644cabff6798aae88099558b832d816", "rev": "a74844b8773fa2f47834775d180e28f8946a1e2c",
"revCount": 31, "revCount": 36,
"type": "git", "type": "git",
"url": "https://git.pvv.ntnu.no/Projects/minecraft-kartverket.git" "url": "https://git.pvv.ntnu.no/Projects/minecraft-kartverket.git"
}, },