filterAttrs is going through all of them I think, but try removeAttrs (or
something similar).
I'm not sure, but probably you want to remove those before importing (or
rather before evaluation), right?
so probably you need to do something like
module = import ./my-module;
module` = removeAttrs...
I remember having som luck with
config = {
myattrs.a = mkForce null;
}
Depending on how the module handles null values, it could work.
-- Layus.
Le 07/09/16 à 00:35, Rickard Nilsson a écrit :
> Is it possible to unset an attrsOf option? Say I import a module that
> looks like this:
>
> option
On 09/07/2016 11:54 AM, 4levels wrote:
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.
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
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