Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Current addToStore API from hnix-store is too limited, we should shape it #176

Closed
soulomoon opened this issue Feb 7, 2022 · 7 comments · Fixed by #177
Closed

Current addToStore API from hnix-store is too limited, we should shape it #176

soulomoon opened this issue Feb 7, 2022 · 7 comments · Fixed by #177

Comments

@soulomoon
Copy link
Contributor

soulomoon commented Feb 7, 2022

To implement fetchurl in hnix, haskell-nix/hnix#1050, haskell-nix/hnix#1051.

We need to perform the following.
Dowload the file content -> dump file content to nar -> Add the nar to remote store.

But in current addToStore api of hnix-store we can just send local file to daemon

@soulomoon

This comment was marked as outdated.

@soulomoon

This comment was marked as off-topic.

@soulomoon soulomoon changed the title Current addToStore api from hnix-store lacking functionality to send string to daemon. Current addToStore API from hnix-store is limited, we should shape it as in nix. Feb 7, 2022
@soulomoon

This comment was marked as outdated.

@soulomoon
Copy link
Contributor Author

soulomoon commented Feb 8, 2022

I have a draft about this #177.

In order to do it we can replace the filepath argument in addToStore with a more common type type NarSource m = (ByteString -> m ()) -> m ().

  • FilePath can turn to NarSource m.
  • Text can turn to NarSource m

@soulomoon soulomoon changed the title Current addToStore API from hnix-store is limited, we should shape it as in nix. Current addToStore API from hnix-store is limited, we should shape it Feb 8, 2022
@soulomoon soulomoon changed the title Current addToStore API from hnix-store is limited, we should shape it Current addToStore API from hnix-store is too limited, we should shape it Feb 8, 2022
@sorki
Copy link
Member

sorki commented Feb 9, 2022

Nice, the remote store API was built against an older nix-store version so some things are a bit dated/different in nix. Feel free to adjust as needed.

@soulomoon
Copy link
Contributor Author

soulomoon commented Feb 9, 2022

@sorki Thank you for the replies. It should now be ready to run the github workflows, awaiting approval. Please approve to run the workflow, and further if you could be available to review the changes.

@soulomoon
Copy link
Contributor Author

Hey @sorki, we should reopen it.
The core part is done, the remote part is not
when the core in hackage is updated, we should also push the remote part.
It is in here #179

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants