[Nix-dev] Modular config and lists

Layus layus.on at gmail.com
Mon Apr 24 21:54:59 CEST 2017


Hi Mark,

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.

-- Layus.

On 24/04/17 18:21, Mark Gardner wrote:
> I separated my configuration into different files by functionality. 
> The goal is to keep like things together and import them as needed to 
> create the final configuration.nix.
>
> My virtualization.nix currently contains:
>
> { config, pkgs, ... }:
> let
>   groups = config.users.users.
> ​myuser>.
> extraGroups;
> in
> {
>   virtualisation = {
>     libvirtd.enable = true;
>   };
>   users.users.
> ​myuser
> .extraGroups = groups ++ [ "libvirtd" ];
> }
>
> ​ but nixos-rebuild gives "​infinite recursion encountered". How do I 
> set things up so that myuser's group membership will include not only 
> what is defined in extraGroup somewhere else but also "libvirtd"?
>
> Mark
> -- 
> Mark Gardner
> --

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


More information about the nix-dev mailing list