[Nix-dev] fetching a single file (not an archive)

Marc Weber marco-oweber at gmx.de
Sat Jan 14 16:25:27 CET 2012


Excerpts from Mathijs Kwik's message of Sat Jan 14 16:11:43 +0100 2012:
> With my limited knowledge of nix, I use fetchurl, which then complains
> about unknown archive type.

You should "grep" nixpkgs for the error message. Then you'll understand
that not fetchurl yells about the achive type - its the unpackPhase of
the default build script.

You can disable it by
a) not using src env var

  eg 
  mkDerivation {
    installPhase = ''
     ensureDir $out/bi
     cp ${fetchurl{ ...}} $out/bin
     chmod +x $out/bin
    '';
  }
  Note that there are shortcuts like writeScript or runCommand or such.

b) overwriting it
  unpackcPhase = ":";
c) overwrite phases 
  phases=" everyhting but unpackPhase";

I recommend a) or b)

Marc Weber


More information about the nix-dev mailing list