From 89b373db53c15c2a5aa4941b0e282fa082d0d09e Mon Sep 17 00:00:00 2001 From: Corwin Perren Date: Sun, 7 Dec 2025 20:06:26 -0800 Subject: [PATCH] Allow git-auto-rebuild without password for admins --- modules/system/git-auto-rebuild.nix | 1 - modules/system/security.nix | 7 +++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/modules/system/git-auto-rebuild.nix b/modules/system/git-auto-rebuild.nix index 5de7284..f5c34b8 100644 --- a/modules/system/git-auto-rebuild.nix +++ b/modules/system/git-auto-rebuild.nix @@ -9,6 +9,5 @@ Type = "simple"; ExecStart = "${pkgs.bash}/bin/bash -c 'cd /etc/nixos && ${pkgs.git}/bin/git pull && ${pkgs.nixos-rebuild}/bin/nixos-rebuild switch --flake #$(hostname)'"; }; - }; } diff --git a/modules/system/security.nix b/modules/system/security.nix index c3dcd7b..2779970 100644 --- a/modules/system/security.nix +++ b/modules/system/security.nix @@ -14,6 +14,13 @@ command = "${pkgs.systemd}/bin/poweroff"; options = [ "NOPASSWD" ]; } + { + commands = [ + "${pkgs.systemd}/bin/systemctl start git-auto-rebuild" + "${pkgs.systemd}/bin/systemctl stop git-auto-rebuild" + ]; + options = [ "NOPASSWD" ]; + } ]; } {