[Nix-dev] Modular config and lists

Layus layus.on at gmail.com
Mon Apr 24 22:16:28 CEST 2017


Hi Mark,

On 24/04/17 22:00, Mark Gardner wrote:
> Hi Layus,
>
> On Mon, Apr 24, 2017 at 3:54 PM, Layus <layus.on at gmail.com 
> <mailto:layus.on at gmail.com>> wrote:
>
>     Have you tried this ?
>
>
>     ```nix
>     { config, pkgs, ... }:
>     {
>       virtualisation.libvirtd.enable = true;
>       users.users.myuser.extraGroups = [ "libvirtd" ];
>     }
>     ```
>
>     This should seamlessly integrate with other options. By default
>     lists will be concatenated, not overwritten.
>
>
> ​No I didn't. I was assuming that the lists would conflict. I tried it 
> and it works. (Obviously my nix understanding is still being formed.)
>
> ​Mark
> -- 
> Mark Gardner
> --

I have looked in the nixos manual (not to be confused with the nix 
manual, or the nixpkgs manual), searching for soe text describing this 
behavior.
I found http://nixos.org/nixos/manual/index.html#sec-modularity. It says 
(amongst other things)

    Note that both |configuration.nix| and |kde.nix| define the option
    |environment.systemPackages|. When multiple modules define an
    option, NixOS will try to /merge/ the definitions. In the case of
    |environment.systemPackages|, that’s easy: the lists of packages can
    simply be concatenated. [...]

Regards,

-- Layus.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.science.uu.nl/pipermail/nix-dev/attachments/20170424/c628a089/attachment.html>


More information about the nix-dev mailing list