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

Initial implementation of fh fetch #160

Merged
merged 14 commits into from
Feb 18, 2025
Merged

Initial implementation of fh fetch #160

merged 14 commits into from
Feb 18, 2025

Conversation

gustavderdrache
Copy link
Contributor

This PR is an initial implementation of fh fetch. Users can request an out link with --out-link. This is supported natively in nix 2.26, so on lower versions we manually create a symbolic link.

token_path: String,
out: Option<&str>,
) -> Result<()> {
match out {
Copy link
Member

Choose a reason for hiding this comment

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

Small nit, but I think we generally prefer the if let Some(out) { ... } else { ... } idiom around these parts

Copy link
Member

@cole-h cole-h left a comment

Choose a reason for hiding this comment

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

LGTM, tested it on this repo and it works fine:

vin@scadrial ~/w/d/fh (fh-fetch-command) 2.2s> cargo r -- fetch DeterminateSystems/fh/0#packages.x86_64-linux.default ./test
   Compiling fh v0.1.21 (/home/vin/workspace/detsys/fh)
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 4.37s
     Running `target/debug/fh fetch 'DeterminateSystems/fh/0#packages.x86_64-linux.default' ./test`
 INFO execute: Resolved DeterminateSystems/fh/0#packages.x86_64-linux.default to /nix/store/4fr2l65x6hkvzpy0xxc9i7v5hq606wh7-fh-20241206-47747e4-0.1.21
 INFO execute: Copied /nix/store/4fr2l65x6hkvzpy0xxc9i7v5hq606wh7-fh-20241206-47747e4-0.1.21 to ./test

@gustavderdrache gustavderdrache merged commit 9dc1d19 into main Feb 18, 2025
8 checks passed
@gustavderdrache gustavderdrache deleted the fh-fetch-command branch February 18, 2025 22:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants