[Nix-dev] Overwriting or merging Nix expressions

Roger Qiu roger.qiu at polycademy.com
Mon Jul 7 08:50:20 CEST 2014


Hello Nix Devs,

I was wondering if there's a way to override Nix expressions.

Say I define a Nix expressions such as:

something.enable = true;

But later on I decide to change it to:

something.enable = false;

Would this work? I find myself getting duplicate errors. One time I had 
something like this:

services.cron.enable = false;

services = {
     other.stuff = blah;
};

And this resulted in a duplicate error. This example is actually more to 
do with merging rather than conflicting entries.

However, say if I had a nix file called B.nix, and in A.nix I imported 
B.nix, I may sometimes want to overwrite that was in B. I find myself 
needing to do this with the generated hardware-configuration.nix file.

Thanks,
Roger

-- 
Founder of Polycademy & SnapSearch
http://polycademy.com
https://snapsearch.io
+61420925975



More information about the nix-dev mailing list