aboutsummaryrefslogtreecommitdiffstats
path: root/modules/communication/senpai/default.nix
diff options
context:
space:
mode:
authorArpit Chakladar <arpitchakladar@gmail.com>2026-09-19 20:17:06 +0530
committerArpit Chakladar <arpitchakladar@gmail.com>2026-09-19 20:17:06 +0530
commitd7b42cf03b93f48d17d0155d409df29ab4599b24 (patch)
treea168b563f09d5f1b16eaf78c7f91df43d6923afa /modules/communication/senpai/default.nix
parent85341ca46a3e46a2b71c4cbc7413b8baa25845b5 (diff)
parent5159ebee1f1a7cdc3afb776c4557b6ab33e69930 (diff)
downloadhome-manager-config-d7b42cf03b93f48d17d0155d409df29ab4599b24.tar.gz
home-manager-config-d7b42cf03b93f48d17d0155d409df29ab4599b24.zip
Merge branch 'irc-with-senpai'
Diffstat (limited to 'modules/communication/senpai/default.nix')
-rw-r--r--modules/communication/senpai/default.nix57
1 files changed, 57 insertions, 0 deletions
diff --git a/modules/communication/senpai/default.nix b/modules/communication/senpai/default.nix
new file mode 100644
index 0000000..51fc041
--- /dev/null
+++ b/modules/communication/senpai/default.nix
@@ -0,0 +1,57 @@
+# Senpai TUI IRC client module
+{
+ config,
+ lib,
+ pkgs,
+ ...
+}:
+{
+ imports = [ ./assertions.nix ];
+
+ options.communication.senpai = {
+ enable = lib.mkEnableOption "Senpai TUI IRC client";
+
+ package = lib.mkOption {
+ type = lib.types.package;
+ default = pkgs.senpai;
+ description = "The senpai package to use.";
+ };
+
+ server = {
+ address = lib.mkOption {
+ type = lib.types.str;
+ description = "IRC server address (host[:port]). Supports irc://, ircs://, irc+insecure:// URLs.";
+ };
+ };
+
+ identity = {
+ nickname = lib.mkOption {
+ type = lib.types.str;
+ description = "Your IRC nickname (no spaces or colons).";
+ };
+
+ passwordGopassSecret = lib.mkOption {
+ type = lib.types.nullOr lib.types.str;
+ default = null;
+ description = "Gopass secret path for SASL password (e.g. irc/user@server). Constructs password-cmd automatically.";
+ };
+ };
+ };
+
+ config = lib.mkIf config.communication.senpai.enable {
+ programs.senpai = {
+ enable = true;
+ package = config.communication.senpai.package;
+ config = {
+ address = config.communication.senpai.server.address;
+ nickname = config.communication.senpai.identity.nickname;
+ password-cmd = lib.mkIf (config.communication.senpai.identity.passwordGopassSecret != null) [
+ (lib.getExe config.security.gopass.package)
+ "show"
+ "-o"
+ config.communication.senpai.identity.passwordGopassSecret
+ ];
+ };
+ };
+ };
+}