anchor.diff:      #! ${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'
  +    if [[ "$USER" != ${cfg.user} ]]; then
  +      sudo='exec /run/wrappers/bin/sudo -u ${cfg.user} --preserve-env=NEXTCLOUD_CONFIG_DIR --preserve-env=OC_PASS'
       fi
       export NEXTCLOUD_CONFIG_DIR="${cfg.home}/config"
       $sudo \
  
positive.code:         nextcloud-cron = {
            environment.NEXTCLOUD_CONFIG_DIR = "${cfg.home}/config";
            serviceConfig.Type = "oneshot";
            serviceConfig.User = "nextcloud";
            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 = "nextcloud";
            startAt = cfg.autoUpdateApps.startAt;
          };
        };
  
        services.phpfpm = {
          pools.nextcloud = {
            user = "nextcloud";
            group = "nginx";
            phpOptions = phpOptionsStr;
            phpPackage = phpPackage;
            phpEnv = {
  
negative.code:       description = "Which package to use for the Nextcloud instance.";
        relatedPackages = [ "nextcloud17" "nextcloud18" "nextcloud19" ];
      };
      user = mkOption {
        type = types.str;
        default = "nextcloud";
        description = "User of the nextcloud service";
      };
      group = mkOption {
        type = with types; nullOr str;
        description = ''
          Set group for nextcloud related services.
          This option cannot be used if <xref linkend="opt-services.nextcloud.nginx.enable"/> is set.
          In this case <xref linkend="opt-services.nginx.group"/> is used instead.";
        '';
      };
  
      maxUploadSize = mkOption {
        default = "512M";
  