From 040cf1e0045b76c43b9e104d185025ed9f4f60ad Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Thu, 23 Apr 2026 12:51:54 -0400 Subject: [PATCH] pureintent: allow passwordless activate rebuild --- configurations/nixos/pureintent/default.nix | 13 +++++++++++++ flake.lock | 6 +++--- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/configurations/nixos/pureintent/default.nix b/configurations/nixos/pureintent/default.nix index 480f52b..bd47f0e 100644 --- a/configurations/nixos/pureintent/default.nix +++ b/configurations/nixos/pureintent/default.nix @@ -8,6 +8,19 @@ in { nixos-unified.sshTarget = "srid@pureintent"; # nixos-unified.sshTarget = "srid@192.168.2.134"; + nixos-unified.localPrivilegeMode = "sudo-nixos-rebuild"; + + security.sudo.extraRules = [ + { + users = [ flake.config.me.username ]; + commands = [ + { + command = "/run/current-system/sw/bin/nixos-rebuild switch *"; + options = [ "NOPASSWD" ]; + } + ]; + } + ]; imports = [ self.nixosModules.default diff --git a/flake.lock b/flake.lock index b105a00..40ac1b8 100644 --- a/flake.lock +++ b/flake.lock @@ -1006,11 +1006,11 @@ }, "nixos-unified_2": { "locked": { - "lastModified": 1764076447, - "narHash": "sha256-dpkdOPPCWaFtDoxVAtVaprtPX6jGl8o30EBc1gWBOnQ=", + "lastModified": 1776962958, + "narHash": "sha256-aSMNDRaVO5HzAKXuK8jeeSrF5HW36sBCU5E5rBnOrbo=", "owner": "srid", "repo": "nixos-unified", - "rev": "90171c6936a8332ede17e09e337a0e71f4e659b1", + "rev": "162fc343504645dbeb4f93ca17064812c4fc4423", "type": "github" }, "original": {