summaryrefslogtreecommitdiff
path: root/os/pc/modules
diff options
context:
space:
mode:
authorsinanmohd <sinan@sinanmohd.com>2024-08-29 22:21:14 +0530
committersinanmohd <sinan@sinanmohd.com>2024-08-29 22:21:14 +0530
commit1c1a361021652f1c300b4cb4c25585bef11cf064 (patch)
tree3b29d208f3a3e4d31e9cb7e35d15eb0bdefd2825 /os/pc/modules
parentcb07f1b1f83996b107118c14d1986ce03c0d6216 (diff)
pc/nopolkit: init
Diffstat (limited to 'os/pc/modules')
-rw-r--r--os/pc/modules/nopolkit.nix26
1 files changed, 26 insertions, 0 deletions
diff --git a/os/pc/modules/nopolkit.nix b/os/pc/modules/nopolkit.nix
new file mode 100644
index 0000000..0c45f41
--- /dev/null
+++ b/os/pc/modules/nopolkit.nix
@@ -0,0 +1,26 @@
+{ config, pkgs, ... }: let
+ user = config.global.userdata.name;
+in {
+ security.sudo = {
+ enable = true;
+
+ extraRules = [{
+ commands = [
+ {
+ command = "${pkgs.systemd}/bin/systemctl suspend-then-hibernate";
+ options = [ "SETENV" "NOPASSWD" ];
+ }
+ {
+ command = "${pkgs.systemd}/bin/reboot";
+ options = [ "NOPASSWD" ];
+ }
+ {
+ command = "${pkgs.systemd}/bin/poweroff";
+ options = [ "NOPASSWD" ];
+ }
+ ];
+
+ users = [ user ];
+ }];
+ };
+}