-
-
Notifications
You must be signed in to change notification settings - Fork 14.5k
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/znc: More flexible module, cleanups #45470
Conversation
''; | ||
}; | ||
|
||
confOptions = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this removes options it definitively need a changelog entry.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added an entry in the release notes for the removed options (the ones that can't be warned against by the module system, the ones in the submodule)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh sorry, forgot to remove this one when I got to the end. 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mean it is a valid point though!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, didn't look at that part in depth and assumed it was compatible. So I guess good thing I forgot.
description = "ZNC Server"; | ||
wantedBy = [ "multi-user.target" ]; | ||
after = [ "network-online.target" ]; | ||
serviceConfig = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if this should have restartIfChanged = false
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see any compelling reason for that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To avoid disconnecting.
config = { | ||
Version = (builtins.parseDrvName pkgs.znc.name).version; | ||
Listener.l.Port = mkDefault 5000; | ||
Listener.l.SSL = mkDefault true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The default for ZNC is to not use SSL, so I explicitly set the default here to turn it on, consistent with the defaults in the old-style config.
I have now tested this with my own ZNC setup, and I think this is ready to be merged. Ping @LnL7 @dustinlacewell |
I'm a ZNC user and this looks good to me. I would request that a (near) future change is made to keep the secret (password and/or password hash) out of the config file so that it's not written to the store, however. |
@@ -200,6 +200,14 @@ $ nix-instantiate -E '(import <nixpkgsunstable> {}).gitFull' | |||
from your config without any issues. | |||
</para> | |||
</listitem> | |||
<listitem> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't forget to move this to 19.03
description = "ZNC Server"; | ||
wantedBy = [ "multi-user.target" ]; | ||
after = [ "network-online.target" ]; | ||
serviceConfig = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To avoid disconnecting.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, but I don't run znc on nixos.
Move legacy options to separate file
Rebased on master to get the release note manual file on 19.03 and moved the release notes there I'll ask around a bit more, but if nobody complains I'll merge this myself. |
Worth mentioning: The first and second commit don't produce a working znc config, so they're not ideal for bisecting, but it would take a lot of work to split them up better. I could squash them if that's desired. |
Squashed the 2 relevant commits into one, made more sense like that |
The |
This option represents the ZNC configuration as a Nix value. It will be converted to a syntactically valid file. This provides: - Flexibility: Any ZNC option can be used - Modularity: These values can be set from any NixOS module and will be merged correctly - Overridability: Default values can be overridden Also done: Remove unused/unneeded options, mkRemovedOptionModule unfortunately doesn't work inside submodules (yet). The options userName and modulePackages were never used to begin with
Pushed some minor description updates |
nixos/znc: Fix regressions introduced in #45470
Motivation for this change
This is the follow up on #41467, which I needed to clean up for a while, and I finally did it.
This adds a new option
services.znc.config
, which can represent the full ZNC configuration as a Nix value, see its description for more info. It's much more flexible than the olderservices.znc.confOptions.*
options. It allows the user to override previously fixed values and to set options that the module system might not know about, as it happens on every ZNC upgrade.Because this new option doesn't know about all valid ZNC options however, it can't do any checks for it to be correct. This doesn't have an easy solution unfortunately. It will generate a syntactically valid file though.
Other changes:
It's now possible to:
The new config option will get converted into the xml-like syntax znc expects, works with all config values, see https://wiki.znc.in/Configuration. This is what one could look like:
To see the current config, you can either inspect it via
nix-instantiate
:Or directly build the config file and look at that:
Unless you disable the new option
services.znc.useLegacyConfig
, the values inservices.znc.confOptions.*
will also have influence onservices.znc.config
, such as a default list of modules, default user, etc. This isn't problematic, the newconfig
options handles merging without trouble.Things done
Ping @nocoolnametom @viric @schneefux @LnL7
Review commit by commit
sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)nix path-info -S
before and after)