irssi: add option for SASL external authentication

This commit is contained in:
David Morgan 2022-10-29 15:58:14 +01:00 committed by Robert Helgesson
parent 423211401c
commit 160025ca46
No known key found for this signature in database
GPG Key ID: 36BDAA14C2797E89
3 changed files with 18 additions and 1 deletions

View File

@ -23,6 +23,11 @@ let
type = "${v.type}";
nick = "${quoteStr v.nick}";
autosendcmd = "${concatMapStringsSep ";" quoteStr v.autoCommands}";
${
lib.optionalString (v.saslExternal) ''
sasl_username = "${quoteStr v.nick}";
sasl_mechanism = "EXTERNAL";''
}
};
''));
@ -36,7 +41,7 @@ let
ssl_verify = "${lib.hm.booleans.yesNo v.server.ssl.verify}";
autoconnect = "${lib.hm.booleans.yesNo v.server.autoConnect}";
${
lib.optionalString (v.server.ssl.certificateFile != null) ''
optionalString (v.server.ssl.certificateFile != null) ''
ssl_cert = "${v.server.ssl.certificateFile}";
''
}
@ -142,6 +147,15 @@ let
type = types.attrsOf channelType;
default = { };
};
saslExternal = mkOption {
type = types.bool;
default = false;
description = ''
Enable SASL external authentication. This requires setting a path in
<xref linkend="opt-programs.irssi.networks._name_.server.ssl.certificateFile"/>.
'';
};
};
});

View File

@ -13,6 +13,8 @@ oftc = {
type = "IRC";
nick = "nick";
autosendcmd = "";
sasl_username = "nick";
sasl_mechanism = "EXTERNAL";
};
};

View File

@ -8,6 +8,7 @@ with lib;
enable = true;
networks.oftc = {
nick = "nick";
saslExternal = true;
server = {
address = "irc.oftc.net";
port = 6697;