Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nixos/knot-resolver: extraFeatures depends on listenDoH, awkward to workaround #81109

Closed
tilpner opened this issue Feb 26, 2020 · 2 comments · Fixed by #81122
Closed

nixos/knot-resolver: extraFeatures depends on listenDoH, awkward to workaround #81109

tilpner opened this issue Feb 26, 2020 · 2 comments · Fixed by #81122

Comments

@tilpner
Copy link
Member

tilpner commented Feb 26, 2020

Describe the bug

My kresd configuration invokes features that depend on cqueues, which is disabled by default
and can be enabled with .override { extraFeatures = true; }.

Since the kresd modules does not have a package option, the user can overlay this new package
and the module will use it. Until 20.03, where the module itself overrides the package again,
undoing my previous override if listenDoH == [].

package = pkgs.knot-resolver.override {
extraFeatures = cfg.listenDoH != [];
};

This can be worked around with

  nixpkgs.overlays = [
    (self: super: rec {
      # this adds lua cqueues, required for watching the rpz file
      # prohibit further overrides, because the kresd module undoes this override
      knot-resolver = (super.knot-resolver.override {
        extraFeatures = true;
      }) // { override = _: knot-resolver; };
    })
  ];

but that's hacky, and there should be a better way.

Expected behavior

Either of these would be better, but I opened an issue instead of a PR, to discuss alternate solutions

  • Add an option to enable features
  • Add a package option
  • Conditionally override if listenDoH != [], but don't override if it's empty

Maintainer information:

# a list of nixpkgs attributes affected by the problem
attribute: knot-resolver
# a list of nixos modules affected by the problem
module: services.kresd

cc @vcunat

@vcunat
Copy link
Member

vcunat commented Feb 26, 2020

🤔 what configuration API would be best?

Off the top of my head, I might choose your second bullet, i.e. adding services.kresd.package that defaults to the current state:

pkgs.knot-resolver.override { extraFeatures = cfg.listenDoH != []; }

The .package options seem pretty standard in NixOS config. But I see no real problem in any of the three approaches you posted.

@vcunat
Copy link
Member

vcunat commented Feb 26, 2020

Actually, I'd probably apply the third one or something similar, as that seems a pure bugfix approach. That doesn't really prevent us also adding something else like the first or second bullet, but that would probably be later than for 20.03.

vcunat added a commit to vcunat/nixpkgs that referenced this issue Feb 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants