feat: add lib.fetchurl function #27

Merged
vlinkz merged 3 commits from srxl/labs:fetchurl into main 2025-10-01 05:20:07 +00:00
Member

See comment in tidepool/src/lib/fetchurl.nix for details on rationale.

I've made this a function in lib instead of defining this as a builder, since we don't have a great mechanism at the moment for specifying the source of a package as another package. We'll need to tackle this eventually, but given that this is a bit of a special case in that it's only intended to be used to fetch sources during bootstrap, I think it's fine to just have this be a function that returns a derivation, instead of being a full builder. Open to other opinions, though.

See comment in `tidepool/src/lib/fetchurl.nix` for details on rationale. I've made this a function in `lib` instead of defining this as a builder, since we don't have a great mechanism at the moment for specifying the source of a package as another package. We'll need to tackle this eventually, but given that this is a bit of a special case in that it's only intended to be used to fetch sources during bootstrap, I think it's fine to just have this be a function that returns a derivation, instead of being a full builder. Open to other opinions, though.
srxl added 2 commits 2025-10-01 01:26:27 +00:00
Performed by running: rg --files-with-matches "builtins\.fetchurl" | xargs sed -i -e
's/builtins\.fetchurl/lib\.fetchurl/g'
vlinkz approved these changes 2025-10-01 02:19:31 +00:00
vlinkz left a comment
Owner

lgtm, we should also convert to use sri hash in hash = ... instead of sha256 = ...

definitely still discussion to be had about what builders/capabilities should cover

lgtm, we should also convert to use sri hash in `hash = ...` instead of `sha256 = ...` definitely still discussion to be had about what builders/capabilities should cover
Author
Member

Was considering swapping the hashes over - I can do that in this PR if we'd like?

Was considering swapping the hashes over - I can do that in this PR if we'd like?
srxl added 1 commit 2025-10-01 03:49:32 +00:00
Author
Member

Went ahead and did the conversion. Was simple enough.

Went ahead and did the conversion. Was simple enough.
Owner

perfect, thanks!

perfect, thanks!
vlinkz merged commit 0ae450a116 into main 2025-10-01 05:20:07 +00:00
vlinkz referenced this pull request from a commit 2025-10-01 05:20:08 +00:00
Owner

I'd like to revert these changes in favor of moving the builtin fetchers to lib since they aren't really a part of the package set.

I'd like to revert these changes in favor of moving the builtin fetchers to `lib` since they aren't really a part of the package set.
srxl deleted branch fetchurl 2025-10-04 22:07:30 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
3 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: auxolotl/labs#27
No description provided.