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
[WIP] znc: more flexible module #41467
Conversation
Yeah, the Bitlbee thing sucks and I am embarrassed that it will forever stand in this repo's history as my first change to Nixpkgs. I didn't really understand Nix-language and that was my workaround for how to implement a channel that doesn't begin with a hash into the generated ZNC confs. Would it make more sense to do something more along these lines, and just make it that channels that start with an ampersand don't get a leading hash? (Or should we be enforcing the leading hash at all? Maybe leave that to the user to add to their configuration options explicitly?) #nixos/modules/services/networking/znc/opts.nix:255
Chan = listToAttrs (map (n: nameValuePair ((if lib.hasPrefix "&" n then "" else "#") + n) {}) net.channels); That's a breaking change, however, so I'm not sure that's the right way to go, either. I like the backward compatibility in your changes so it allows people to upgrade nicely. Fixing/Removing the Bitlbee flag is probably something that should wait until later. |
@nocoolnametom I'm actually not sure why I added the "What to do about the bitlebee thing" to the Todo list now. This previous option can just stay as it is. And if somebody needs additional channels not starting with "#" they can use the new config style which doesn't have this restriction. |
- Will make it easy to add support for any additional znc config file options - Will provide a way to override default config file options - Generates a nicer config file without unnecessary newlines and proper tabs
- Put extraConfig at bottom - Allow null to unset values - Add options for semantic config and config file by default being generated by the semantic config - Fix network.service -> network.target - Make start script work with dataDir's that contain space - Add passblock comment, now support semantic and string version
- Split legacy options into other file - Fix start script syntax error - Open all ports in the semantic config
- Use import instead of submodule to be able to put all legacy stuff into own file - Don't ignore old zncConf string, properly set default priorities
fb61464
to
c09bdea
Compare
I am working on a new version of this PR with lots of cleanups on this branch: https://github.com/Infinisil/nixpkgs/tree/znc-config I'll open a new PR when I'm done with it |
This bug was introduced in NixOS#41467
This commit adds one major new option to the znc module:
services.znc.config. It can represents the full ZNC configuration as a
Nix value, see its description for more info. It acts as a more
flexible alternative for the older services.znc.confOptions.* options.
Effectively this also allows the user to change previously fixed options. Along
with this comes a nicely generated config file with proper indentation.
Unless I made a mistake, these changes are 100% backwards compatible.
Other changes:
names
services.znc.modulePackages option by default, because they are very
small (<100KB each)
separate file.
It's now possible to:
The new configuration style is a direct translation of the xml-like znc config file syntax, all the options are described in the official ZNC wiki. It looks like this:
If you don't define the new
config
option, the legacyconfOptions
option will be used for it.My better-znc-module branch contains the unsquashed version of this PR. It would probably have been nicer to have multiple commits because of the many changes.
Pinging the people who have toched the module in the past: @layus @mbrgm @vaibhavsagar @nocoolnametom @schneefux @lethalman
And pinging the maintainers of the package: @viric @schneefux @LnL7
Todo
services.znc.config
description explains it pretty well already though.