Allow git-auto-rebuild without password for admins

This commit is contained in:
2025-12-07 20:06:26 -08:00
parent 5d041ac5c7
commit 89b373db53
2 changed files with 7 additions and 1 deletions

View File

@@ -9,6 +9,5 @@
Type = "simple"; 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)'"; ExecStart = "${pkgs.bash}/bin/bash -c 'cd /etc/nixos && ${pkgs.git}/bin/git pull && ${pkgs.nixos-rebuild}/bin/nixos-rebuild switch --flake #$(hostname)'";
}; };
}; };
} }

View File

@@ -14,6 +14,13 @@
command = "${pkgs.systemd}/bin/poweroff"; command = "${pkgs.systemd}/bin/poweroff";
options = [ "NOPASSWD" ]; options = [ "NOPASSWD" ];
} }
{
commands = [
"${pkgs.systemd}/bin/systemctl start git-auto-rebuild"
"${pkgs.systemd}/bin/systemctl stop git-auto-rebuild"
];
options = [ "NOPASSWD" ];
}
]; ];
} }
{ {