browser configure sudo

This commit is contained in:
Ingolf Wagner 2020-10-12 22:46:55 +02:00
parent ad79c38764
commit 9e2fd423bd
No known key found for this signature in database
GPG key ID: 76BF5F1928B9618B

View file

@ -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