browser configure sudo
This commit is contained in:
parent
ad79c38764
commit
9e2fd423bd
1 changed files with 9 additions and 3 deletions
|
@ -203,9 +203,15 @@ in {
|
|||
# add sudo rights
|
||||
security.sudo.extraConfig = let
|
||||
extraRules = flip mapAttrsToList cfg.configList (name: values:
|
||||
concatStringsSep "\n"
|
||||
(map (sudoUser: "${sudoUser} ALL=(${values.user}) NOPASSWD: ALL")
|
||||
values.sudoUsers));
|
||||
concatStringsSep "" (map (sudoUser: ''
|
||||
# sudo configuration to control browser
|
||||
${sudoUser} ALL=(${values.user}) NOPASSWD: ALL
|
||||
${sudoUser} ALL=(root) NOPASSWD: /run/current-system/sw/bin/mkdir -p ${values.home}
|
||||
${sudoUser} ALL=(root) NOPASSWD: /run/current-system/sw/bin/chown -R ${values.user}\:users ${values.home}
|
||||
${sudoUser} ALL=(root) NOPASSWD: /run/current-system/sw/bin/killall -9 -u ${name}
|
||||
${sudoUser} ALL=(root) NOPASSWD: /run/current-system/sw/bin/rm -rf ${values.home}
|
||||
${sudoUser} ALL=(root) NOPASSWD: /run/current-system/sw/bin/rm ${values.home}-lock
|
||||
'') values.sudoUsers));
|
||||
in lib.concatStringsSep "\n" extraRules;
|
||||
|
||||
# create users
|
||||
|
|
Loading…
Reference in a new issue