[Nix-dev] Re: NixOS: New scheme - small explanation of fix

Ludovic Courtès ludo at gnu.org
Thu Nov 20 22:35:55 CET 2008


Hi!

"Nicolas Pierron"
<nicolas.b.pierron at gmail.com> writes:

> The point is that all NixOS configuration files have an
> argument/attribute called "config".  This attribute correspond to the
> result of the computer configuration.  The fix function plus a merge
> function ("require" attribute) allow the config attribute to look into
> to the evaluated version of attributes.
>
> {config, pkgs}:
>
> {
>   services = {
>     foo = {
>       enable = mkOption { default = false; };
>     };
>
>     bar = {
>       enable = config.services.foo.enable; // not necessary false
>     };
>   };
> }

OK, I understand, thank you for your patience!

Ludo'.




More information about the nix-dev mailing list