[Nix-dev] Patching uname in stdenv?

Michael Raskin 7c6f434c at mail.ru
Wed Aug 17 17:02:09 CEST 2011


>On 08/17/2011 03:16 AM, Michael Raskin wrote:
>>> Hi all,
>>>
>>> What would people think of a patch that made stdenv's uname return the
>>> same value on every linux? I've only just had the idea and haven't had
>>> time to think through the possible downsides, but my initial thought is
>>> that most packages shouldn't need to know the kernel version, and that
>>> those that have a reason to (e.g. packages that provide kernel modules)
>>> should be dependent on the kernel passed to the nix expression, rather
>>> than whatever the kernel happens to be in memory at a given time. Or am I
>>> wrong? Is there a reason a build should depend on which version of the
>> I guess default uname should say version of kernel from kernelheaders
>> used for glibc, and kernelPackages one should say the kernel version
>> of the passed kernel?
>Default being the version of kernelheaders seems like the way to do it. 
>Not sure how stdenv is supposed to find out which version of the kernel 
>was passed for kernelPackages, though.

# nix-instantiate --eval-only /etc/nixos/nixpkgs/ -A linuxPackages.kernel.version
"2.6.32.44"

kernelHeaders currently do not put version in an attribute, but put it
in a file. This can be changed easily. 

kernelPackages could replace uname with its own one - dependent on 
kernel.version.






More information about the nix-dev mailing list