···94949595 programs.home-manager.enable = true;
96969797- # ── Nextcloud desktop client: allow syncing files of any size ────────────
9898- # The client defaults to blocking files over ~500 MB. This activation script
9999- # patches the setting in-place so credentials/tokens in the file are preserved.
9797+ # ── Nextcloud desktop client ─────────────────────────────────────────────
9898+ # Both activation scripts below patch nextcloud.cfg in-place so that
9999+ # credentials/tokens already written by the client are preserved.
100100+101101+ # Enable VFS (virtual files) for all configured sync folders — files appear
102102+ # as lightweight placeholders locally and are only downloaded on access,
103103+ # keeping the primary copy on the server. Linux uses "suffix" mode (.nextcloud
104104+ # placeholder files); this is a no-op if VFS is already on or if the cfg
105105+ # file doesn't exist yet (new installs pick it up after first sync setup).
106106+ home.activation.nextcloudVFS = lib.mkIf (cfg.isDesktop && !isDarwin) (
107107+ lib.hm.dag.entryAfter [ "writeBoundary" ] ''
108108+ cfg_file="$HOME/.config/Nextcloud/nextcloud.cfg"
109109+ if [ -f "$cfg_file" ]; then
110110+ $DRY_RUN_CMD ${pkgs.gnused}/bin/sed -i 's/virtualFilesMode=off/virtualFilesMode=suffix/g' "$cfg_file"
111111+ fi
112112+ ''
113113+ );
114114+115115+ # Allow syncing files of any size (client default blocks files over ~500 MB).
100116 home.activation.nextcloudMaxSize = lib.mkIf cfg.isDesktop (
101117 lib.hm.dag.entryAfter [ "writeBoundary" ] ''
102118 cfg_file="$HOME/.config/Nextcloud/nextcloud.cfg"