From f31c271d7baccc7f37a7b96ce4b2c8bab551a8a0 Mon Sep 17 00:00:00 2001 From: Hadi <112569860+anotherhadi@users.noreply.github.com> Date: Mon, 24 Mar 2025 15:58:45 +0100 Subject: [PATCH] no password for rebuild --- nixos/nix.nix | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/nixos/nix.nix b/nixos/nix.nix index 235ac30..47bafaa 100644 --- a/nixos/nix.nix +++ b/nixos/nix.nix @@ -1,6 +1,13 @@ { config, inputs, ... }: let autoGarbageCollector = config.var.autoGarbageCollector; in { + security.sudo.extraRules = [{ + users = [ config.var.username ]; + commands = [{ + command = "/run/current-system/sw/bin/nixos-rebuild"; + options = [ "NOPASSWD" ]; + }]; + }]; nixpkgs.config = { allowUnfree = true; allowBroken = true;