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

Add flake support #35

Open
terlar opened this issue Feb 20, 2022 · 3 comments · May be fixed by #34
Open

Add flake support #35

terlar opened this issue Feb 20, 2022 · 3 comments · May be fixed by #34

Comments

@terlar
Copy link

terlar commented Feb 20, 2022

Currently when trying to use nix-prefetch with something that requires flakes it will fail, it is testing for flake but only adds --experimental-features nix-command:
https://github.com/msteen/nix-prefetch/blob/master/src/main.sh#L163

I have a flake that provides a packages that is using fixed output hashes (go-modules vendor stuff). I would like to do something like:

nix-prefetch '{ sha256 }: (builtins.getFlake (toString ./.)).packages.x86_64-linux.terraform-provider-aws.go-modules.overrideAttrs (_: { vendorSha256 = sha256; })'

This commands will refuse to evaluate due to flakes feature not being enabled.

Would it make sense to add this, or is it possible to provide extra flags to the nix command via the nix-prefetch CLI?

@ShamrockLee
Copy link

@terlar #34 should fix this issue.

@Shados
Copy link

Shados commented Aug 13, 2023

... or is it possible to provide extra flags to the nix command via the nix-prefetch CLI?

It is, nix-prefetch --option extra-experimental-features flakes works fine.

@jakubgs
Copy link

jakubgs commented Nov 8, 2023

I tried using this:

nix-prefetch --option extra-experimental-features flakes '{ sha256 }: (builtins.getFlake (toString ./.)).packages.x86_64-linux.node.go-modules.overrideAttrs (_: { vendorSha256 = sha256; })'

With the fake in this repo: https://github.com/status-im/go-waku

But I get no output. This is what I get with -vv:

 > nix-prefetch -vv '{ sha256 }: (builtins.getFlake (toString ./.)).packages.x86_64-linux.node.go-modules.overrideAttrs (_: { vendorSha256 = sha256; })' 
The following Bash variables have been set:
> file='<nixpkgs>'
> expr='{ sha256 }: (builtins.getFlake (toString ./.)).packages.x86_64-linux.node.go-modules.overrideAttrs (_: { vendorSha256 = sha256; })'
> fetchurl=0
> force_https=1
> input_type=''
> output_type=raw
> print_path=0
> print_urls=0
> compute_hash=1
> check_store=0
> silent=0
> quiet=0
> verbose=1
> debug=1
> eval=''
> autocomplete=0
> help=0

The following Nix function call will be evaluated:
> prefetch {
> 

I have no idea what that means.

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