add variable
This commit is contained in:
@@ -1,5 +1,8 @@
|
|||||||
{ pkgs, username, ... }:
|
{ pkgs, username, ... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
binPath = "${pkgs.nix}/bin";
|
||||||
|
in
|
||||||
{
|
{
|
||||||
nix.settings.trusted-users = [ username ];
|
nix.settings.trusted-users = [ username ];
|
||||||
|
|
||||||
@@ -31,7 +34,7 @@
|
|||||||
commands =
|
commands =
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
command = "/run/current-system/sw/bin/nix-store";
|
command = "${binPath}/nix-store";
|
||||||
options = [ "NOPASSWD" ];
|
options = [ "NOPASSWD" ];
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
@@ -39,15 +42,11 @@
|
|||||||
options = [ "NOPASSWD" "SETENV" ];
|
options = [ "NOPASSWD" "SETENV" ];
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
command = "${pkgs.systemd}/bin/systemctl suspend";
|
command = "${binPath}/reboot";
|
||||||
options = [ "NOPASSWD" ];
|
options = [ "NOPASSWD" ];
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
command = "${pkgs.systemd}/bin/reboot";
|
command = "${binPath}/poweroff";
|
||||||
options = [ "NOPASSWD" ];
|
|
||||||
}
|
|
||||||
{
|
|
||||||
command = "${pkgs.systemd}/bin/poweroff";
|
|
||||||
options = [ "NOPASSWD" ];
|
options = [ "NOPASSWD" ];
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|||||||
Reference in New Issue
Block a user