From ae9ad56134c94445acfb9f20f7ea49f5522bad11 Mon Sep 17 00:00:00 2001 From: alex Date: Mon, 21 Apr 2025 23:25:48 +0800 Subject: [PATCH] fix syntax issue --- modules/nixos/user.nix | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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" ]; } ];