Re: [Nix-dev] Overwriting or merging Nix expressions

2014-08-18 Thread Roger Qiu
Hello Nicolas, You mean something like this? something.enable = mkDefault 101 true; # at 101 something.enable = false; # at 100 Or something like: something.enable = true; # at 100 something.enable = mkOverride 99 false; # at 99 In both cases the second something.enable has a lower priority th

Re: [Nix-dev] Overwriting or merging Nix expressions

2014-08-17 Thread Nicolas Pierron
On Sun, Aug 17, 2014 at 6:33 AM, Roger Qiu wrote: > You mean something like this? > > something.enable = mkDefault 101 true; # at 101 > something.enable = false; # at 100 something.enable = mkDefault true; # at 1000 [1] something.enable = false; # at 100 [1] https://github.com/NixOS/nixpkgs/blob

Re: [Nix-dev] Overwriting or merging Nix expressions

2014-08-16 Thread Nicolas Pierron
Hi Roger, Sorry for the late answer. On Mon, Jul 7, 2014 at 8:50 AM, Roger Qiu wrote: > I was wondering if there's a way to override Nix expressions. I think you are specifically talking about NixOS modules, right? > Say I define a Nix expressions such as: > > something.enable = true; > > But

Re: [Nix-dev] Overwriting or merging Nix expressions

2014-07-08 Thread Roger Qiu
Hello Wout, Do you mean something like this: # Inside B.nix something.enable = true; # Inside A.nix that imports B.nix something.enable // false; The link you sent me didn't give an example of overwriting a previous expression. Also what about the merging of: services.cron.enable = false;

Re: [Nix-dev] Overwriting or merging Nix expressions

2014-07-07 Thread Wout Mertens
Hi Roger, to override in this way, you can merge attribute sets with the // operator, which will prefer the attribute on the right-hand side. http://nixos.org/nix/manual/#idm47361539098656 you get the duplicate error because the language is functional, everything at the same level is evaluated a

[Nix-dev] Overwriting or merging Nix expressions

2014-07-07 Thread Roger Qiu
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 li