irssi: add ssl_cert option for servers (#2043)

* irssi: add ssl_cert option for servers

I was following these instructions
https://www.oftc.net/NickServ/CertFP/
and found that the `/server add -ssl_cert` option was needed.

This patch therefore adds an optional
`programs.irssi.networks.<name>.server.ssl.certificateFile` path.

Perhaps this could also be done with a `settings` attribute, but that
would probably require most of this module to be reworked.

* irsii: Add example-settings test case
This commit is contained in:
Rodney Lorrimar 2021-06-07 07:31:25 +10:00 committed by GitHub
parent 7591c8041d
commit afb5fd962c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 88 additions and 0 deletions

View file

@ -35,6 +35,9 @@ let
use_ssl = "${boolStr v.server.ssl.enable}";
ssl_verify = "${boolStr v.server.ssl.verify}";
autoconnect = "${boolStr v.server.autoConnect}";
${lib.optionalString (v.server.ssl.certificateFile != null) ''
ssl_cert = "${v.server.ssl.certificateFile}";
''}
}
''));
@ -118,6 +121,15 @@ let
default = true;
description = "Whether the SSL certificate should be verified.";
};
certificateFile = mkOption {
type = types.nullOr types.path;
default = null;
description = ''
Path to a file containing the certificate used for
client authentication to the server.
'';
};
};
autoConnect = mkOption {