ZNC: Difference between revisions
imported>Mth No edit summary |
imported>Mth No edit summary |
||
Line 9: | Line 9: | ||
mutable = false; # Overwrite configuration set by ZNC from the web and chat interfaces. | mutable = false; # Overwrite configuration set by ZNC from the web and chat interfaces. | ||
useLegacyConfig = false; # Turn off services.znc.confOptions and their defaults. | useLegacyConfig = false; # Turn off services.znc.confOptions and their defaults. | ||
openFirewall = true; # ZNC uses TCP port 5000 by default. | |||
}; | }; | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Line 14: | Line 15: | ||
And use <code>services.znc.config</code> to configure ZNC as described in [https://wiki.znc.in/Configuration Configuration] on the ZNC wiki. | And use <code>services.znc.config</code> to configure ZNC as described in [https://wiki.znc.in/Configuration Configuration] on the ZNC wiki. | ||
=Clients= | |||
Generate a password with: | Generate a password with: | ||
Line 23: | Line 24: | ||
Then, in <code>configuration.nix</code>: | Then, in <code>configuration.nix</code>: | ||
<syntaxhighlight lang="nix"> | <syntaxhighlight lang="nix"> | ||
services.znc | services.znc.config = { | ||
LoadModule = [ "adminlog" ]; # Write access logs to ~znc/moddata/adminlog/znc.log. | |||
User.bob = { | |||
Admin = true; | |||
Pass.password = { | |||
Method = "sha256"; # Fill out this section with the generated password. | |||
Hash = "..."; | |||
Salt = "..."; | |||
}; | }; | ||
}; | }; | ||
Line 45: | Line 42: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Next, see [https://wiki.znc.in/Connecting_to_ZNC Connecting] and [https://wiki.znc.in/Category:Clients Category:Clients] on the ZNC wiki. | |||
=Networks= | |||
SASL authentication is not yet supported from <code>configuration.nix</code>. Either <code>/msg *sasl</code> <ref>See [https://wiki.znc.in/Sasl Sasl] on the ZNC wiki.</ref> or use NickServ instead as shown below. | |||
{{ | <syntaxhighlight lang="nix"> | ||
service.znc.config.User.bob = { | |||
Network.freenode = { # The nickserv module will | |||
Server = "chat.freenode.net +6697 yourpassword"; # <- pick up your password here. | |||
Chan = { "#nixos" = {}; "#nixos-wiki" = {}; }; | |||
Nick = "bob"; | |||
LoadModule = [ "nickserv" ]; | |||
JoinDelay = 2; # Avoid joining channels before authenticating. | |||
}; | |||
}; | |||
</syntaxhighlight> |