[Nix-dev] nix modules: Unsetting attrsOf options?

4levels 4levels at gmail.com
Wed Sep 7 11:54:51 CEST 2016


Hi Rickard,

All I can think of currently is that you could create a new config variable
using filterAttrs to keep only the information you need.
Not sure if this solves your question though as I'm not aware if you can
use another variable in your scenario.

Kind regards,

Erik

On Wed, Sep 7, 2016 at 12:35 AM Rickard Nilsson <rickard.nilsson at telia.com>
wrote:

> Is it possible to unset an attrsOf option? Say I import a module that
> looks like this:
>
> options = {
>    myattrs = mkOption {
>      type = types.attrsOf ...
>      default = {};
>    };
> }
>
> config = {
>    myattrs = {
>      a = ...
>      b = ...
>    };
> };
>
> And then I want to remove the "a" attribute in the importing config:
>
> config = {
>    myattrs.a = mkForce ...
> }
>
> Is that possible in any way?
>
>
>    / Rickard
> _______________________________________________
> nix-dev mailing list
> nix-dev at lists.science.uu.nl
> http://lists.science.uu.nl/mailman/listinfo/nix-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.science.uu.nl/pipermail/nix-dev/attachments/20160907/5fabac71/attachment.html>


More information about the nix-dev mailing list