[Nix-dev] CPU optimized packages

Eelco Dolstra eelco.dolstra at logicblox.com
Thu Feb 7 19:00:23 CET 2013


Hi,

On 07/02/13 16:20, Danny Wilson wrote:

> Eh nevermind the md5sum, I see a builtins.readFile in the docs but no string
> hashing function to shorten it.
> 
> Would something like:
> 
>   import (pkgs.runCommand "cflags" {cpuinfo = builtins.readFile "/proc/cpuinfo";
> __noChroot = true;} ''
> 
> work?

Unfortunately not, since readFile "/proc/cpuinfo" will return an empty string.
This is because readFile trusts the file size (i.e. 0) returned by the kernel.

-- 
Eelco Dolstra | LogicBlox, Inc. | http://nixos.org/~eelco/


More information about the nix-dev mailing list