aboutsummaryrefslogtreecommitdiffstats
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
parent85341ca46a3e46a2b71c4cbc7413b8baa25845b5 (diff)
parent5159ebee1f1a7cdc3afb776c4557b6ab33e69930 (diff)
downloadhome-manager-config-d7b42cf03b93f48d17d0155d409df29ab4599b24.tar.gz
home-manager-config-d7b42cf03b93f48d17d0155d409df29ab4599b24.zip
Merge branch 'irc-with-senpai'
-rw-r--r--modules/communication/default.nix3
-rw-r--r--modules/communication/senpai/assertions.nix20
-rw-r--r--modules/communication/senpai/default.nix57
-rw-r--r--modules/office/calcurse/default.nix2
-rw-r--r--users/arpit/default.nix1
-rw-r--r--users/arpit/private.example.nix11
6 files changed, 92 insertions, 2 deletions
diff --git a/modules/communication/default.nix b/modules/communication/default.nix
index 70afc8d..1c7fd6a 100644
--- a/modules/communication/default.nix
+++ b/modules/communication/default.nix
@@ -1,7 +1,8 @@
-# Email client modules
+# Communication modules
{ ... }:
{
imports = [
./neomutt
+ ./senpai
];
}
diff --git a/modules/communication/senpai/assertions.nix b/modules/communication/senpai/assertions.nix
new file mode 100644
index 0000000..ed2cce8
--- /dev/null
+++ b/modules/communication/senpai/assertions.nix
@@ -0,0 +1,20 @@
+# Validates Senpai dependencies.
+{ config, ... }:
+{
+ assertions = [
+ {
+ assertion = !config.communication.senpai.enable || config.communication.senpai.server.address != "";
+ message = "communication.senpai.enable requires communication.senpai.server.address to be set.";
+ }
+ {
+ assertion =
+ !config.communication.senpai.enable || config.communication.senpai.identity.nickname != "";
+ message = "communication.senpai.enable requires communication.senpai.identity.nickname to be set.";
+ }
+ {
+ assertion =
+ config.communication.senpai.identity.passwordGopassSecret == null || config.security.gopass.enable;
+ message = "communication.senpai.identity.passwordGopassSecret requires security.gopass.enable.";
+ }
+ ];
+}
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
+ ];
+ };
+ };
+ };
+}
diff --git a/modules/office/calcurse/default.nix b/modules/office/calcurse/default.nix
index 0a4acba..2f86500 100644
--- a/modules/office/calcurse/default.nix
+++ b/modules/office/calcurse/default.nix
@@ -125,7 +125,7 @@ in
tag.gpgSign = false;
}
// lib.optionalAttrs (config.office.calcurse.sync.credential.passwordGopassPath != null) {
- credential.helper = "!f() { echo username=${lib.escapeShellArg config.office.calcurse.sync.credential.username}; echo password=\"$(${config.security.gopass.package}/bin/gopass show -o ${lib.escapeShellArg config.office.calcurse.sync.credential.passwordGopassPath})\"; }; f";
+ credential.helper = "!f() { echo username=${lib.escapeShellArg config.office.calcurse.sync.credential.username}; echo password=\"$(${lib.getExe config.security.gopass.package} show -o ${lib.escapeShellArg config.office.calcurse.sync.credential.passwordGopassPath})\"; }; f";
};
}
];
diff --git a/users/arpit/default.nix b/users/arpit/default.nix
index 7e35156..00acf8d 100644
--- a/users/arpit/default.nix
+++ b/users/arpit/default.nix
@@ -27,6 +27,7 @@
# Communication
communication.neomutt.enable = true;
+ communication.senpai.enable = true;
# Development
development.bruno.enable = true;
diff --git a/users/arpit/private.example.nix b/users/arpit/private.example.nix
index 2f169d9..3752f68 100644
--- a/users/arpit/private.example.nix
+++ b/users/arpit/private.example.nix
@@ -28,6 +28,17 @@
};
};
+ # Senpai - Template for configuring senpai IRC client
+ config.communication.senpai = {
+ server = {
+ address = "irc.example.com";
+ };
+ identity = {
+ nickname = "example";
+ passwordGopassSecret = "irc/user@irc.example.com";
+ };
+ };
+
# Git - Template for configuring git identity and signing
config.development.git = {
username = "Your Name";