From 3bbe6d359e995d6f2e88bcd77de578195a6ca457 Mon Sep 17 00:00:00 2001 From: John Lancaster <32917998+jsl12@users.noreply.github.com> Date: Thu, 12 Mar 2026 12:49:02 -0500 Subject: [PATCH] no password for sudo if admin --- modules/nix-tools/user.nix | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/modules/nix-tools/user.nix b/modules/nix-tools/user.nix index 03de100..8e29574 100644 --- a/modules/nix-tools/user.nix +++ b/modules/nix-tools/user.nix @@ -15,6 +15,19 @@ "wheel" ]; }; + + # Removes password for sudo + security.sudo-rs = lib.mkIf isAdmin { + enable = true; + extraRules = [{ + users = [ "john" ]; + commands = [{ + command = "ALL"; + options = [ "NOPASSWD" ]; + }]; + }]; + }; + # https://github.com/Doc-Steve/dendritic-design-with-flake-parts/wiki/Dendritic_Aspects#multi-context-aspect home-manager.users."${username}" = { home.username = "${username}";