+
+ security.sudo.extraRules = lib.mkAfter [{
+ groups = [ "users" ];
+ commands = [{
+ command = "${auto-upgrade-script}";
+ options = [ "NOPASSWD" "NOSETENV" ];
+ }];
+ }];
+ # NOSETENV above still allows through ~17 vars, including PATH. Block those
+ # as well:
+ security.sudo.extraConfig = ''
+ Defaults!${auto-upgrade-script} !env_check
+ Defaults!${auto-upgrade-script} !env_keep
+ '';
+