Skip to content

Conversation

@gcurtis
Copy link
Collaborator

@gcurtis gcurtis commented Apr 12, 2023

Depends on #896.


This is a hack to get a rudimentary package search (by attribute path) working natively in Devbox. For example, to install Go 1.19:

remoteStore, _ := Remote("https://cache.nixos.org") remotePkg, _ := remoteStore.PackageAttrPath("go_1_19") localStore, _ := Local("/nix/store") localStore.Install(remotePkg)

The attribute path lookup relies on embedding a gzipped JSON index of all nixpkgs at commit 3fb8eedc450. This file adds 4.7 MiB to the size of the Devbox binary. Ideally this index would be downloaded as-needed instead.

This is a hack to get a rudimentary package search (by attribute path) working natively in Devbox. For example, to install Go 1.19: ```go remoteStore, _ := Remote("https://cache.nixos.org") remotePkg, _ := remoteStore.PackageAttrPath("go_1_19") localStore, _ := Local("/nix/store") localStore.Install(remotePkg) ``` The attribute path lookup relies on embedding a gzipped JSON index of all nixpkgs at commit 3fb8eedc450. This file adds 4.7 MiB to the size of the Devbox binary. Ideally this index would be downloaded as-needed instead.
@gcurtis gcurtis requested review from ipince, loreto and mikeland73 April 12, 2023 21:07
@gcurtis
Copy link
Collaborator Author

gcurtis commented Apr 12, 2023

If anyone thinks the embedded file is too large, I can hold off on this and get a better implementation working by downloading it at runtime.

@mikeland73
Copy link
Collaborator

Not necessarily opposed to embedding, but generally prefer downloading. Is this part of a general strategy for search? or is it tangential?

@loreto
Copy link
Contributor

loreto commented Apr 13, 2023

I think downloading (or API) is the way to go. But in the interest of Always Be Shipping, I think it's totally cool to embed as a first pass, and get the search feature out. 4.7 MiB feels reasonable to me, so I'd be inclined to ship this!

@gcurtis
Copy link
Collaborator Author

gcurtis commented Apr 13, 2023

Not necessarily opposed to embedding, but generally prefer downloading. Is this part of a general strategy for search? or is it tangential?

It's more of a first step to get something working for search. I don't think this will (or should) be the final implementation.

Copy link
Collaborator

@mikeland73 mikeland73 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we shelve this in favor of server side search for now?

I think this is a good idea, but would prefer lazy download to avoid the increase in size but I don't think it's a priority

@loreto
Copy link
Contributor

loreto commented Jun 2, 2023

Is this PR abandoned? (should we close it in that case?)

@gcurtis gcurtis closed this Jun 27, 2023
@gcurtis gcurtis deleted the gcurtis/nixstore-attrpath branch September 27, 2024 15:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

4 participants