aboutsummaryrefslogtreecommitdiffstats
path: root/modules/communication
diff options
context:
space:
mode:
authorArpit Chakladar <arpitchakladar@gmail.com>2026-09-20 04:00:07 +0530
committerArpit Chakladar <arpitchakladar@gmail.com>2026-09-20 04:00:07 +0530
commitfb442560064f98ee850c71d78330b9b3abda4774 (patch)
tree31fad467ca31b2f9127f4ea254eab76f4ce18a5f /modules/communication
parentc3c245c7633885f6860191eede646d048def3e0d (diff)
downloadhome-manager-config-fb442560064f98ee850c71d78330b9b3abda4774.tar.gz
home-manager-config-fb442560064f98ee850c71d78330b9b3abda4774.zip
chore: added option guards to desktop entries for tuis
Diffstat (limited to 'modules/communication')
-rw-r--r--modules/communication/neomutt/default.nix92
-rw-r--r--modules/communication/senpai/default.nix65
2 files changed, 82 insertions, 75 deletions
diff --git a/modules/communication/neomutt/default.nix b/modules/communication/neomutt/default.nix
index b9f22e0..e003c7f 100644
--- a/modules/communication/neomutt/default.nix
+++ b/modules/communication/neomutt/default.nix
@@ -60,51 +60,55 @@ in
};
};
- config = lib.mkIf config.communication.neomutt.enable {
- accounts.email.maildirBasePath = "${config.home.homeDirectory}/.local/share/mail";
- home.sessionVariables.MAILDIR = config.accounts.email.maildirBasePath;
+ config = lib.mkMerge [
+ (lib.mkIf config.communication.neomutt.enable {
+ accounts.email.maildirBasePath = "${config.home.homeDirectory}/.local/share/mail";
+ home.sessionVariables.MAILDIR = config.accounts.email.maildirBasePath;
- xdg.desktopEntries."neomutt" = {
- name = "NeoMutt";
- exec = "${lib.getExe config.terminal.kitty.package} --class neomutt -e ${lib.getExe config.programs.neomutt.package}";
- icon = "${config.programs.neomutt.package}/share/neomutt/logo/neomutt.svg";
- categories = [
- "Network"
- "Email"
- ];
- comment = "Terminal email client";
- terminal = false;
- type = "Application";
- };
- xdg.mimeApps.defaultApplications = {
- "x-scheme-handler/mailto" = "neomutt.desktop";
- };
- xdg.configFile."neomutt/mailcap".text =
- builtins.replaceStrings [ "@@HTML_VIEWER@@" ] [ (lib.getExe config.web.chawan.package) ]
- (builtins.readFile ./mailcap);
- programs.neomutt = {
- enable = true;
- package = pkgs.symlinkJoin {
- name = "neomutt-wrapped";
- paths = [
- pkgs.neomutt
- neomuttSync
+ xdg.configFile."neomutt/mailcap".text =
+ builtins.replaceStrings [ "@@HTML_VIEWER@@" ] [ (lib.getExe config.web.chawan.package) ]
+ (builtins.readFile ./mailcap);
+ programs.neomutt = {
+ enable = true;
+ package = pkgs.symlinkJoin {
+ name = "neomutt-wrapped";
+ paths = [
+ pkgs.neomutt
+ neomuttSync
+ ];
+ nativeBuildInputs = [ pkgs.makeWrapper ];
+ postBuild = ''
+ wrapProgram $out/bin/neomutt \
+ --prefix PATH : ${config.home.profileDirectory}/bin:${lib.makeBinPath [ pkgs.urlscan ]}
+ '';
+ meta.mainProgram = "neomutt";
+ };
+ sidebar.enable = true;
+ sort = "reverse-threads";
+ vimKeys = false;
+ unmailboxes = true;
+ checkStatsInterval = 20;
+ extraConfig =
+ builtins.replaceStrings [ "@@PAGER@@" ] [ (lib.getExe config.development.nixvim.package) ]
+ (builtins.readFile ./.neomuttrc);
+ };
+ })
+ (lib.mkIf (config.communication.neomutt.enable && config.terminal.kitty.enable) {
+ xdg.desktopEntries."neomutt" = {
+ name = "NeoMutt";
+ exec = "${lib.getExe config.terminal.kitty.package} --class neomutt -e ${lib.getExe config.programs.neomutt.package}";
+ icon = "${config.programs.neomutt.package}/share/neomutt/logo/neomutt.svg";
+ categories = [
+ "Network"
+ "Email"
];
- nativeBuildInputs = [ pkgs.makeWrapper ];
- postBuild = ''
- wrapProgram $out/bin/neomutt \
- --prefix PATH : ${config.home.profileDirectory}/bin:${lib.makeBinPath [ pkgs.urlscan ]}
- '';
- meta.mainProgram = "neomutt";
+ comment = "Terminal email client";
+ terminal = false;
+ type = "Application";
};
- sidebar.enable = true;
- sort = "reverse-threads";
- vimKeys = false;
- unmailboxes = true;
- checkStatsInterval = 20;
- extraConfig =
- builtins.replaceStrings [ "@@PAGER@@" ] [ (lib.getExe config.development.nixvim.package) ]
- (builtins.readFile ./.neomuttrc);
- };
- };
+ xdg.mimeApps.defaultApplications = {
+ "x-scheme-handler/mailto" = "neomutt.desktop";
+ };
+ })
+ ];
}
diff --git a/modules/communication/senpai/default.nix b/modules/communication/senpai/default.nix
index 57a921a..56bb7ab 100644
--- a/modules/communication/senpai/default.nix
+++ b/modules/communication/senpai/default.nix
@@ -38,38 +38,41 @@
};
};
- 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
+ config = lib.mkMerge [
+ (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
+ ];
+ };
+ };
+ })
+ (lib.mkIf (config.communication.senpai.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}";
+ icon = "senpai";
+ categories = [
+ "Network"
+ "Chat"
];
+ comment = "Senpai TUI IRC Client";
+ terminal = false;
+ type = "Application";
};
- };
-
- xdg.desktopEntries."senpai" = lib.mkIf config.terminal.kitty.enable {
- name = "Senpai";
- exec = "${lib.getExe config.terminal.kitty.package} --class senpai -e ${lib.getExe config.communication.senpai.package}";
- icon = "senpai";
- categories = [
- "Network"
- "Chat"
- ];
- comment = "Senpai TUI IRC Client";
- terminal = false;
- type = "Application";
- };
- xdg.mimeApps.defaultApplications = {
- "x-scheme-handler/irc" = "senpai.desktop";
- "x-scheme-handler/ircs" = "senpai.desktop";
- };
- };
+ xdg.mimeApps.defaultApplications = {
+ "x-scheme-handler/irc" = "senpai.desktop";
+ "x-scheme-handler/ircs" = "senpai.desktop";
+ };
+ })
+ ];
}