[Nix-dev] Nix 1.2 released

Shea Levy shea at shealevy.com
Wed Dec 12 03:38:00 CET 2012


On 12/11/2012 09:28 PM, Florian Friesdorf wrote:
> Hi Eelco,
>
> great work!
>
> Eelco Dolstra <eelco.dolstra at logicblox.com> writes:
>>    * Nix no longer sets the immutable bit on files in the Nix store. Instead,
>>      the recommended way to guard the Nix store against accidental modification
>>      on Linux is to make it a read-only bind mount, like this:
>>
>>      $ mount --bind /nix/store /nix/store
>>      $ mount -o remount,ro,bind /nix/store
>>
>>      Nix will automatically make /nix/store writable as needed (using a private
>>      mount namespace) to allow modifications.
> Where would be the correct place to put these commands?

The NixOS option nix.readOnlyStore in the systemd branch adds a command 
to the stage-2 init (the "real" init after the initrd finishes its 
setup). This is done very early in stage-2 
(https://github.com/NixOS/nixos/blob/859badc9663240f7d3c4279d9e657134f8395f17/modules/system/boot/stage-2-init.sh#L48). 
So that's probably a good guide for non-nixos systems.

>>    * Basic Nix expression evaluation profiling: setting the environment variable
>>      NIX_COUNT_CALLS to 1 will cause Nix to print how many times each primop or
>>      function was executed.
>>
>>    * New primops: concatLists, elem, elemAt and filter.
> The elem library function evaluates all list elements instead of
> returning "true" after finding a matching element. How does the builtin
> elem function behave?

The builtin function breaks out of the comparison loop after a match is 
found (https://github.com/NixOS/nix/blob/1.2/src/libexpr/primops.cc#L980).

> regards
> florian
>
>
> _______________________________________________
> nix-dev mailing list
> nix-dev at lists.science.uu.nl
> http://lists.science.uu.nl/mailman/listinfo/nix-dev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.science.uu.nl/pipermail/nix-dev/attachments/20121211/32f85781/attachment.html 


More information about the nix-dev mailing list