anchor.diff:              PATH = "/run/wrappers/bin:/nix/var/nix/profiles/default/bin:/run/current-system/sw/bin:/usr/bin:/bin";
             };
             settings = mapAttrs (name: mkDefault) {
  -            "listen.owner" = cfg.user;
  -            "listen.group" = group;
  +            "listen.owner" = serverUser;
  +            "listen.group" = config.users.users.${serverUser}.group;
             } // cfg.poolSettings;
             extraConfig = cfg.poolConfig;
           };
         };
   
  -      users.extraUsers.${cfg.user} = {
  +      users.users.nextcloud = {
           home = "${cfg.home}";
  -        inherit group;
  +        group = "nextcloud";
           createHome = true;
         };
  +      users.groups.nextcloud.members = [ "nextcloud" "${serverUser}" ];
   
         environment.systemPackages = [ occ ];
       }
  
positive.code:             ${occSetTrustedDomainsCmd}
            '';
            serviceConfig.Type = "oneshot";
          };
          nextcloud-cron = {
            environment.NEXTCLOUD_CONFIG_DIR = "${cfg.home}/config";
            serviceConfig.Type = "oneshot";
            serviceConfig.User = cfg.user;
            serviceConfig.ExecStart = "${phpPackage}/bin/php -f ${cfg.package}/cron.php";
          };
          nextcloud-update-plugins = mkIf cfg.autoUpdateApps.enable {
            serviceConfig.Type = "oneshot";
            serviceConfig.ExecStart = "${occ}/bin/nextcloud-occ app:update --all";
            serviceConfig.User = cfg.user;
            startAt = cfg.autoUpdateApps.startAt;
          };
        };
  
        services.phpfpm = {
          pools.nextcloud = {
            user = cfg.user;
            inherit group;
            phpOptions = phpOptionsStr;
            phpPackage = phpPackage;
            phpEnv = {
  
negative.code:     #! ${pkgs.runtimeShell}
      cd ${cfg.package}
      sudo=exec
      if [[ "$USER" != nextcloud ]]; then
        sudo='exec /run/wrappers/bin/sudo -u nextcloud --preserve-env=NEXTCLOUD_CONFIG_DIR --preserve-env=OC_PASS'
      fi
      export NEXTCLOUD_CONFIG_DIR="${cfg.home}/config"
      $sudo \
  