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

Backport fetchTarball hash #1299

Closed
FRidh opened this issue Apr 4, 2017 · 5 comments
Closed

Backport fetchTarball hash #1299

FRidh opened this issue Apr 4, 2017 · 5 comments

Comments

@FRidh
Copy link
Member

FRidh commented Apr 4, 2017

Could we have 06bbfb6 in 1.11.x?

@taktoa
Copy link
Member

taktoa commented Jul 20, 2017

Seconded; we could really use this here at Awake Security.

@taktoa
Copy link
Member

taktoa commented Jul 20, 2017

In the mean time, you can use

import <nix/fetchurl.nix> {
  url = "https://example.com/foo.nar";
  sha256 = "0hk0zxxibl7r62nmzaf4qbdrqack5xs7skcys82bqi8glf2qjr7z";
  system = builtins.currentSystem;
  executable = false;
  unpack = true;
}

(unpack = true requires the URL to be a NAR file)

Here's a good example: https://gist.github.com/taktoa/4ec8b0cb6d07857400b07a830ad99558

@FRidh
Copy link
Member Author

FRidh commented Jul 21, 2017

Interesting. I knew fetchTarball shared code path and the only difference was the unpack parameter, but I didn't know you could just import it.

We could create a fetchTarball function in Nixpkgs that utilizes this until Nix 1.12 is stable. @edolstra, is there any reason against doing that?

@edolstra
Copy link
Member

@FRidh 06bbfb6 does not cherry-pick straightforwardly on the 1.11 branch, so I'd prefer not to, sorry.

builtins.fetchTarball and <nix/fetchurl.nix> are very different in that the former doesn't rely on import-from-derivation. Import-from-derivation should generally be avoided in Nixpkgs because it causes builds at evaluation time (which fails in read-only mode, e.g. in nix-env -qa).

@FRidh
Copy link
Member Author

FRidh commented Jul 21, 2017

Thank you for the clarification. I'm a happy user of 1.12 so I don't really mind.

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

No branches or pull requests

3 participants