summaryrefslogtreecommitdiff
path: root/os/pc
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
parentcb07f1b1f83996b107118c14d1986ce03c0d6216 (diff)
pc/nopolkit: init
Diffstat (limited to 'os/pc')
-rw-r--r--os/pc/configuration.nix1
-rw-r--r--os/pc/modules/nopolkit.nix26
2 files changed, 27 insertions, 0 deletions
diff --git a/os/pc/configuration.nix b/os/pc/configuration.nix
index e865580..180080f 100644
--- a/os/pc/configuration.nix
+++ b/os/pc/configuration.nix
@@ -8,6 +8,7 @@ in {
./modules/sshfs.nix
./modules/network.nix
./modules/wayland.nix
+ ./modules/nopolkit.nix
];
boot = {
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 ];
+ }];
+ };
+}