diff --git a/modules/nixos/user.nix b/modules/nixos/user.nix index 92eb99e..a03f07e 100644 --- a/modules/nixos/user.nix +++ b/modules/nixos/user.nix @@ -1,5 +1,8 @@ { pkgs, username, ... }: +let + binPath = "${pkgs.nix}/bin"; +in { nix.settings.trusted-users = [ username ]; @@ -23,8 +26,6 @@ }; }; - binPath = "${pkgs.nix}/bin"; - # DO NOT promote the specified user to input password for `nix-store` and `nix-copy-closure` security.sudo = { # wheelNeedsPassword = false; @@ -46,7 +47,7 @@ options = [ "NOPASSWD" ]; } { - command = "${binPath}/bin/poweroff"; + command = "${binPath}/poweroff"; options = [ "NOPASSWD" ]; } ];