diff options
| author | Arpit Chakladar <arpitchakladar@gmail.com> | 2026-09-19 19:48:42 +0530 |
|---|---|---|
| committer | Arpit Chakladar <arpitchakladar@gmail.com> | 2026-09-19 19:48:42 +0530 |
| commit | 5159ebee1f1a7cdc3afb776c4557b6ab33e69930 (patch) | |
| tree | a168b563f09d5f1b16eaf78c7f91df43d6923afa | |
| parent | 85341ca46a3e46a2b71c4cbc7413b8baa25845b5 (diff) | |
| download | home-manager-config-5159ebee1f1a7cdc3afb776c4557b6ab33e69930.tar.gz home-manager-config-5159ebee1f1a7cdc3afb776c4557b6ab33e69930.zip | |
feat(communication/senpai): added the IRC client senpai configurations
| -rw-r--r-- | modules/communication/default.nix | 3 | ||||
| -rw-r--r-- | modules/communication/senpai/assertions.nix | 20 | ||||
| -rw-r--r-- | modules/communication/senpai/default.nix | 57 | ||||
| -rw-r--r-- | modules/office/calcurse/default.nix | 2 | ||||
| -rw-r--r-- | users/arpit/default.nix | 1 | ||||
| -rw-r--r-- | users/arpit/private.example.nix | 11 |
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"; |
