Commit b9e0398

HPCesia <me@hpcesia.com>
2026-08-01 17:35:06
Add sudo config
1 parent 1220e38
Changed files (1)
modules
modules/core/sudo.nix
@@ -0,0 +1,25 @@
+{
+  den.aspects.core.sudo = {
+    nixos = {pkgs, ...}: {
+      security.sudo = {
+        enable = true;
+        package = pkgs.sudo.override {withInsults = true;};
+        extraRules = [
+          {
+            commands =
+              map
+              (command: {
+                command = "/run/current-system/sw/bin/${command}";
+                options = ["NOPASSWD"];
+              })
+              [
+                "poweroff"
+                "reboot"
+              ];
+            groups = ["wheel"];
+          }
+        ];
+      };
+    };
+  };
+}