diff options
| author | Arpit Chakladar <arpitchakladar@gmail.com> | 2026-09-24 03:42:34 +0530 |
|---|---|---|
| committer | Arpit Chakladar <arpitchakladar@gmail.com> | 2026-09-24 03:42:34 +0530 |
| commit | 44b8624d201e70c8418ada5db3c46e9ba130ea30 (patch) | |
| tree | ab960997bf8831d294dd84838523b358b7012ac5 /modules/communication/senpai | |
| parent | 30f8fea050f3242f0e6a2072779e706b5c8ceaf1 (diff) | |
| download | home-manager-config-44b8624d201e70c8418ada5db3c46e9ba130ea30.tar.gz home-manager-config-44b8624d201e70c8418ada5db3c46e9ba130ea30.zip | |
refactor(naming): use kebab-case option names and consistent gopass secret naming
Diffstat (limited to 'modules/communication/senpai')
| -rw-r--r-- | modules/communication/senpai/assertions.nix | 5 | ||||
| -rw-r--r-- | modules/communication/senpai/default.nix | 57 |
2 files changed, 39 insertions, 23 deletions
diff --git a/modules/communication/senpai/assertions.nix b/modules/communication/senpai/assertions.nix index ed2cce8..8e74367 100644 --- a/modules/communication/senpai/assertions.nix +++ b/modules/communication/senpai/assertions.nix @@ -13,8 +13,9 @@ } { assertion = - config.communication.senpai.identity.passwordGopassSecret == null || config.security.gopass.enable; - message = "communication.senpai.identity.passwordGopassSecret requires security.gopass.enable."; + config.communication.senpai.identity.password-gopass-secret == null + || config.security.gopass.enable; + message = "communication.senpai.identity.password-gopass-secret requires security.gopass.enable."; } ]; } diff --git a/modules/communication/senpai/default.nix b/modules/communication/senpai/default.nix index 56bb7ab..49f82d9 100644 --- a/modules/communication/senpai/default.nix +++ b/modules/communication/senpai/default.nix @@ -5,6 +5,9 @@ pkgs, ... }: +let + cfg = config.communication.senpai; +in { imports = [ ./assertions.nix ]; @@ -17,48 +20,60 @@ 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."; + server = lib.mkOption { + type = lib.types.submodule { + options = { + address = lib.mkOption { + type = lib.types.str; + description = "IRC server address (host[:port]). Supports irc://, ircs://, irc+insecure:// URLs."; + }; + }; }; + default = { }; + description = "IRC server configuration."; }; - identity = { - nickname = lib.mkOption { - type = lib.types.str; - description = "Your IRC nickname (no spaces or colons)."; - }; + identity = lib.mkOption { + type = lib.types.submodule { + options = { + 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."; + password-gopass-secret = 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."; + }; + }; }; + default = { }; + description = "Identity configuration."; }; }; config = lib.mkMerge [ - (lib.mkIf config.communication.senpai.enable { + (lib.mkIf cfg.enable { programs.senpai = { enable = true; - package = config.communication.senpai.package; + package = cfg.package; config = { - address = config.communication.senpai.server.address; - nickname = config.communication.senpai.identity.nickname; - password-cmd = lib.mkIf (config.communication.senpai.identity.passwordGopassSecret != null) [ + address = cfg.server.address; + nickname = cfg.identity.nickname; + password-cmd = lib.mkIf (cfg.identity.password-gopass-secret != null) [ (lib.getExe config.security.gopass.package) "show" "-o" - config.communication.senpai.identity.passwordGopassSecret + cfg.identity.password-gopass-secret ]; }; }; }) - (lib.mkIf (config.communication.senpai.enable && config.terminal.kitty.enable) { + (lib.mkIf (cfg.enable && config.terminal.kitty.enable) { xdg.desktopEntries."senpai" = { name = "Senpai"; - exec = "${lib.getExe config.terminal.kitty.package} --class senpai -e ${lib.getExe config.communication.senpai.package}"; + exec = "${lib.getExe config.terminal.kitty.package} --class senpai -e ${lib.getExe cfg.package}"; icon = "senpai"; categories = [ "Network" |
