Add R2 rclone mount apps under ~/darkmatter#1
Conversation
Introduces a flake-parts module exposing mount-darkmatter,
unmount-darkmatter, and configure-darkmatter-r2 apps so team
members can attach Cloudflare R2 buckets at ~/darkmatter/{public,
team,personal} with a single rclone remote.
https://claude.ai/code/session_01RX1FoRF99mdTXmX5VR5ruH
Hercules CI evaluation was failing because the workflow file was built via builtins.readFile of yaml.generate's output, which forces an import-from-derivation for every system at eval time. Replace that with a runCommand that prepends the comment header at build time, eliminating the IFD without changing the rendered YAML. https://claude.ai/code/session_01RX1FoRF99mdTXmX5VR5ruH
PR SummaryMedium Risk Overview Enables the R2 module by default in this repo’s Reviewed by Cursor Bugbot for commit 9fdaa06. Configure here. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is ON, but it could not run because the branch was deleted or merged before autofix could start.
Reviewed by Cursor Bugbot for commit 9fdaa06. Configure here.
| base="''${DARKMATTER_BASE_DIR:-${cfg.baseDir}}" | ||
| base="''${base/#\~/$HOME}" | ||
|
|
||
| if ! rclone listremotes | grep -qx "''${remote}:"; then |
There was a problem hiding this comment.
Remote name regex matching instead of literal string
Low Severity
The grep -qx call treats remoteName as a basic regular expression rather than a fixed string. If remoteName contains regex metacharacters (e.g., a . in something like company.r2), the check could incorrectly match a different remote (like companyXr2:), causing the script to skip the helpful "remote not found" error and proceed to fail with a confusing rclone error. The mount-point checks on lines 133 and 166 correctly use grep -F for literal matching, but this remote-existence check does not.
Reviewed by Cursor Bugbot for commit 9fdaa06. Configure here.


Summary
flake-partsmodule (modules/flake-parts/r2.nix, exported asflakeModules.r2) that exposes three runnable apps backed byrclone:configure-darkmatter-r2— one-time interactive setup of thedarkmatter-r2rclone remote (readsR2_ACCOUNT_ID/R2_ACCESS_KEY_ID/R2_SECRET_ACCESS_KEYif set, otherwise prompts).mount-darkmatter— mounts every configured bucket (or a single one passed as an arg) under~/darkmatter/<name>viarclone mount --daemon.unmount-darkmatter— unmounts viafusermount3/fusermount/umountas appropriate.~/darkmatter/{public,team,personal}backed bydarkmatter-{public,team,personal}R2 buckets. Bucket names, mount root (DARKMATTER_BASE_DIRenv override),vfs-cache-mode, and per-mountextraMountArgsare all configurable throughdarkmatter.r2options.flake.nixand update the README's "Shared Flake Utilities" section to document the new commands (replaces the previously-documented but unimplementedrclone-s3snippet).Test plan
nix flake checkevaluates clean onx86_64-linuxandaarch64-darwinnix run .#configure-darkmatter-r2creates a workingdarkmatter-r2rclone remotenix run .#mount-darkmattermounts all three buckets under~/darkmatternix run .#mount-darkmatter -- teammounts only the team bucketnix run .#unmount-darkmatterreleases all mounts cleanlyhttps://claude.ai/code/session_01RX1FoRF99mdTXmX5VR5ruH
Generated by Claude Code