aboutsummaryrefslogtreecommitdiffstats
path: root/modules
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
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')
-rw-r--r--modules/communication/neomutt/default.nix92
-rw-r--r--modules/communication/senpai/default.nix65
-rw-r--r--modules/development/lazygit/default.nix143
-rw-r--r--modules/development/opencode/default.nix49
-rw-r--r--modules/file-management/yazi/default.nix9
-rw-r--r--modules/media/screen-recording/default.nix35
-rw-r--r--modules/office/calcurse/default.nix119
-rw-r--r--modules/security/gopass/default.nix4
-rw-r--r--modules/security/gpg-tui/default.nix35
-rw-r--r--modules/system/btop/default.nix43
-rw-r--r--modules/system/systemctl-tui/default.nix35
-rw-r--r--modules/web/chawan/default.nix72
12 files changed, 363 insertions, 338 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";
+ };
+ })
+ ];
}
diff --git a/modules/development/lazygit/default.nix b/modules/development/lazygit/default.nix
index 1e83ed0..c2e6be8 100644
--- a/modules/development/lazygit/default.nix
+++ b/modules/development/lazygit/default.nix
@@ -21,79 +21,80 @@ in
description = "The lazygit package to use.";
};
};
- config = {
- home.file.".local/share/icons/hicolor/scalable/apps/git.svg" =
- lib.mkIf config.development.lazygit.enable
- {
- source = ../../../assets/icons/apps/git.svg;
- };
-
- xdg.desktopEntries."lazygit" = lib.mkIf config.development.lazygit.enable {
- name = "lazygit";
- exec = "${lib.getExe config.terminal.kitty.package} --class lazygit -e ${lib.getExe config.development.lazygit.package}";
- icon = "git";
- categories = [ "Development" ];
- comment = "A simple terminal UI for git commands";
- terminal = false;
- type = "Application";
- };
-
- programs.lazygit = lib.mkIf config.development.lazygit.enable {
- enable = true;
- enableBashIntegration = false;
- enableZshIntegration = config.terminal.zsh.enable;
- settings = {
- gui = with base16Colors.colorsWithHashPrefix; {
- theme = {
- lightTheme = false;
- activeBorderColor = [
- base0D
- "bold"
- ];
- inactiveBorderColor = [ base03 ];
- optionsTextColor = [ base0D ];
- selectedLineBgColor = [ base01 ];
- selectedRangeBgColor = [ base01 ];
- cherryPickedCommitBgColor = [ base0C ];
- cherryPickedCommitFgColor = [ base0D ];
- markedBaseCommitBgColor = [ base0A ];
- markedBaseCommitFgColor = [ base0D ];
- unstagedChangesColor = [ base08 ];
- defaultFgColor = [ base05 ];
- searchingActiveBorderColor = [
- base0A
- "bold"
- ];
+ config = lib.mkMerge [
+ (lib.mkIf config.development.lazygit.enable {
+ programs.lazygit = {
+ enable = true;
+ enableBashIntegration = false;
+ enableZshIntegration = config.terminal.zsh.enable;
+ settings = {
+ gui = with base16Colors.colorsWithHashPrefix; {
+ theme = {
+ lightTheme = false;
+ activeBorderColor = [
+ base0D
+ "bold"
+ ];
+ inactiveBorderColor = [ base03 ];
+ optionsTextColor = [ base0D ];
+ selectedLineBgColor = [ base01 ];
+ selectedRangeBgColor = [ base01 ];
+ cherryPickedCommitBgColor = [ base0C ];
+ cherryPickedCommitFgColor = [ base0D ];
+ markedBaseCommitBgColor = [ base0A ];
+ markedBaseCommitFgColor = [ base0D ];
+ unstagedChangesColor = [ base08 ];
+ defaultFgColor = [ base05 ];
+ searchingActiveBorderColor = [
+ base0A
+ "bold"
+ ];
+ };
+ authorColors = {
+ "*" = base0E;
+ };
+ branchColors = {
+ "master" = base08;
+ "main" = base08;
+ };
+ showIcons = true;
+ scrollHeight = 2;
+ nerdFontsVersion = "3";
+ scrollPastBottom = true;
+ mouseEvents = true;
+ border = "single";
+ commitHashLength = 4;
+ showBranchCommitHash = true;
+ showDivergenceFromBaseBranch = "arrowAndNumber";
+ autoFetch = false;
};
- authorColors = {
- "*" = base0E;
- };
- branchColors = {
- "master" = base08;
- "main" = base08;
+ git = {
+ overrideGpg = config.security.gpg.enable;
+ diffRenderers = lib.mkIf config.development.delta.enable [
+ {
+ colorArg = "always";
+ command = "delta --paging=never {{diffArgs}}";
+ }
+ ];
};
- showIcons = true;
- scrollHeight = 2;
- nerdFontsVersion = "3";
- scrollPastBottom = true;
- mouseEvents = true;
- border = "single";
- commitHashLength = 4;
- showBranchCommitHash = true;
- showDivergenceFromBaseBranch = "arrowAndNumber";
- autoFetch = false;
+ update.method = "never";
};
- git = {
- overrideGpg = config.security.gpg.enable;
- diffRenderers = lib.mkIf config.development.delta.enable [
- {
- colorArg = "always";
- command = "delta --paging=never {{diffArgs}}";
- }
- ];
- };
- update.method = "never";
};
- };
- };
+
+ home.file.".local/share/icons/hicolor/scalable/apps/git.svg" = {
+ source = ../../../assets/icons/apps/git.svg;
+ };
+ })
+ (lib.mkIf (config.development.lazygit.enable && config.terminal.kitty.enable) {
+ xdg.desktopEntries."lazygit" = {
+ name = "lazygit";
+ exec = "${lib.getExe config.terminal.kitty.package} --class lazygit -e ${lib.getExe config.development.lazygit.package}";
+ icon = "git";
+ categories = [ "Development" ];
+ comment = "A simple terminal UI for git commands";
+ terminal = false;
+ type = "Application";
+ };
+ })
+ ];
}
diff --git a/modules/development/opencode/default.nix b/modules/development/opencode/default.nix
index 04796d9..011582e 100644
--- a/modules/development/opencode/default.nix
+++ b/modules/development/opencode/default.nix
@@ -16,30 +16,31 @@
};
};
- config = lib.mkIf config.development.opencode.enable {
- home.file.".local/share/icons/hicolor/scalable/apps/opencode.svg" =
- lib.mkIf config.development.opencode.enable
- {
- source = ../../../assets/icons/apps/opencode.svg;
- };
+ config = lib.mkMerge [
+ (lib.mkIf config.development.opencode.enable {
+ home.file.".local/share/icons/hicolor/scalable/apps/opencode.svg" = {
+ source = ../../../assets/icons/apps/opencode.svg;
+ };
- xdg.desktopEntries."opencode" = {
- name = "opencode";
- exec = "${lib.getExe config.terminal.kitty.package} --class opencode -e ${lib.getExe config.development.opencode.package}";
- icon = "opencode";
- categories = [ "Development" ];
- comment = "AI-powered coding assistant";
- terminal = false;
- type = "Application";
- };
-
- programs.opencode = {
- enable = true;
- package = pkgs.opencode;
- };
+ programs.opencode = {
+ enable = true;
+ package = pkgs.opencode;
+ };
+ })
+ (lib.mkIf (config.development.opencode.enable && config.terminal.kitty.enable) {
+ xdg.desktopEntries."opencode" = {
+ name = "opencode";
+ exec = "${lib.getExe config.terminal.kitty.package} --class opencode -e ${lib.getExe config.development.opencode.package}";
+ icon = "opencode";
+ categories = [ "Development" ];
+ comment = "AI-powered coding assistant";
+ terminal = false;
+ type = "Application";
+ };
- xdg.mimeApps.defaultApplications = {
- "x-scheme-handler/opencode" = "opencode.desktop";
- };
- };
+ xdg.mimeApps.defaultApplications = {
+ "x-scheme-handler/opencode" = "opencode.desktop";
+ };
+ })
+ ];
}
diff --git a/modules/file-management/yazi/default.nix b/modules/file-management/yazi/default.nix
index 70a7326..ba1c020 100644
--- a/modules/file-management/yazi/default.nix
+++ b/modules/file-management/yazi/default.nix
@@ -60,6 +60,11 @@ in
source = config.lib.file.mkOutOfStoreSymlink "${config.file-management.yazi.package}/share/pixmaps/yazi.png";
};
+ home.sessionVariables = {
+ TERMCMD = lib.mkIf config.terminal.kitty.enable "${lib.getExe config.terminal.kitty.package} --class file-explorer --title 'Yazi'";
+ };
+ })
+ (lib.mkIf (config.file-management.yazi.enable && config.terminal.kitty.enable) {
xdg.desktopEntries."yazi" = {
name = "Yazi";
exec = "${lib.getExe config.terminal.kitty.package} --class yazi -e ${lib.getExe config.file-management.yazi.package}";
@@ -78,10 +83,6 @@ in
"application/x-7z-compressed" = "yazi.desktop";
"application/x-rar-compressed" = "yazi.desktop";
};
-
- home.sessionVariables = {
- TERMCMD = lib.mkIf config.terminal.kitty.enable "${lib.getExe config.terminal.kitty.package} --class file-explorer --title 'Yazi'";
- };
})
(lib.mkIf config.file-management.yazi.file-chooser.enable {
home.file.".config/xdg-desktop-portal-termfilechooser/config" = {
diff --git a/modules/media/screen-recording/default.nix b/modules/media/screen-recording/default.nix
index 67e422c..d9ae89e 100644
--- a/modules/media/screen-recording/default.nix
+++ b/modules/media/screen-recording/default.nix
@@ -47,22 +47,25 @@ in
};
};
- config = lib.mkIf config.media.screen-recording.enable {
- home.packages = [ scriptPkg ];
+ config = lib.mkMerge [
+ (lib.mkIf config.media.screen-recording.enable {
+ home.packages = [ scriptPkg ];
- assertions = import ./assertions.nix { inherit config lib; };
+ assertions = import ./assertions.nix { inherit config lib; };
- home.file.".local/share/icons/hicolor/scalable/apps/obs.svg" = {
- source = ../../../assets/icons/apps/obs.svg;
- };
-
- xdg.desktopEntries.screen-recording = {
- name = "Screen Recording";
- exec = "${lib.getExe config.terminal.kitty.package} --class screen-recording -e ${lib.getExe scriptPkg}";
- icon = "obs";
- categories = [ "Utility" ];
- terminal = false;
- type = "Application";
- };
- };
+ home.file.".local/share/icons/hicolor/scalable/apps/obs.svg" = {
+ source = ../../../assets/icons/apps/obs.svg;
+ };
+ })
+ (lib.mkIf (config.media.screen-recording.enable && config.terminal.kitty.enable) {
+ xdg.desktopEntries.screen-recording = {
+ name = "Screen Recording";
+ exec = "${lib.getExe config.terminal.kitty.package} --class screen-recording -e ${lib.getExe scriptPkg}";
+ icon = "obs";
+ categories = [ "Utility" ];
+ terminal = false;
+ type = "Application";
+ };
+ })
+ ];
}
diff --git a/modules/office/calcurse/default.nix b/modules/office/calcurse/default.nix
index 2f86500..2b0a19f 100644
--- a/modules/office/calcurse/default.nix
+++ b/modules/office/calcurse/default.nix
@@ -71,69 +71,68 @@ in
};
};
- config = lib.mkIf config.office.calcurse.enable (
- lib.mkMerge [
- {
- home.file.".local/share/icons/hicolor/scalable/apps/calcurse.svg" = {
- source = ../../../assets/icons/apps/calcurse.svg;
- };
-
- xdg.desktopEntries."calcurse" = {
- name = "calcurse";
- exec = "${lib.getExe config.terminal.kitty.package} --class calcurse -e ${lib.getExe config.office.calcurse.package}";
- icon = "calcurse";
- categories = [
- "Office"
- "Calendar"
- ];
- comment = "Text-based calendar and scheduling application";
- terminal = false;
- type = "Application";
- };
+ config = lib.mkMerge [
+ (lib.mkIf config.office.calcurse.enable {
+ home.file.".local/share/icons/hicolor/scalable/apps/calcurse.svg" = {
+ source = ../../../assets/icons/apps/calcurse.svg;
+ };
- home.packages = [ config.office.calcurse.package ];
- xdg.configFile."calcurse/conf" = {
- source = ./conf;
- force = true;
- };
- xdg.configFile."calcurse/keys" = {
- source = ./keys;
- force = true;
- };
- }
- (lib.mkIf config.office.calcurse.sync.enable {
- xdg.configFile."calcurse/hooks/pre-load" = {
- source = ./hooks/pre-load;
- executable = true;
- force = true;
- };
- xdg.configFile."calcurse/hooks/post-save" = {
- source = ./hooks/post-save;
- executable = true;
- force = true;
- };
+ home.packages = [ config.office.calcurse.package ];
+ xdg.configFile."calcurse/conf" = {
+ source = ./conf;
+ force = true;
+ };
+ xdg.configFile."calcurse/keys" = {
+ source = ./keys;
+ force = true;
+ };
+ })
+ (lib.mkIf (config.office.calcurse.enable && config.terminal.kitty.enable) {
+ xdg.desktopEntries."calcurse" = {
+ name = "calcurse";
+ exec = "${lib.getExe config.terminal.kitty.package} --class calcurse -e ${lib.getExe config.office.calcurse.package}";
+ icon = "calcurse";
+ categories = [
+ "Office"
+ "Calendar"
+ ];
+ comment = "Text-based calendar and scheduling application";
+ terminal = false;
+ type = "Application";
+ };
+ })
+ (lib.mkIf config.office.calcurse.sync.enable {
+ xdg.configFile."calcurse/hooks/pre-load" = {
+ source = ./hooks/pre-load;
+ executable = true;
+ force = true;
+ };
+ xdg.configFile."calcurse/hooks/post-save" = {
+ source = ./hooks/post-save;
+ executable = true;
+ force = true;
+ };
- programs.git.includes = lib.mkIf config.development.git.enable [
- {
- condition = "gitdir:${config.xdg.dataHome}/calcurse/";
- contents = {
- user = {
- name = "Calcurse of ${config.home.username}";
- email = "${config.home.username}@calcurse.localhost";
- };
- commit.gpgSign = false;
- 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=\"$(${lib.getExe config.security.gopass.package} show -o ${lib.escapeShellArg config.office.calcurse.sync.credential.passwordGopassPath})\"; }; f";
+ programs.git.includes = lib.mkIf config.development.git.enable [
+ {
+ condition = "gitdir:${config.xdg.dataHome}/calcurse/";
+ contents = {
+ user = {
+ name = "Calcurse of ${config.home.username}";
+ email = "${config.home.username}@calcurse.localhost";
};
+ commit.gpgSign = false;
+ 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=\"$(${lib.getExe config.security.gopass.package} show -o ${lib.escapeShellArg config.office.calcurse.sync.credential.passwordGopassPath})\"; }; f";
+ };
+ }
+ ];
- home.activation.calcurseSyncInit = lib.hm.dag.entryAfter [ "writeBoundary" ] ''
- run ${config.office.calcurse.package}/bin/calcurse-sync init || true
- '';
- })
- ]
- );
+ home.activation.calcurseSyncInit = lib.hm.dag.entryAfter [ "writeBoundary" ] ''
+ run ${config.office.calcurse.package}/bin/calcurse-sync init || true
+ '';
+ })
+ ];
}
diff --git a/modules/security/gopass/default.nix b/modules/security/gopass/default.nix
index 123b33f..aa0a0d6 100644
--- a/modules/security/gopass/default.nix
+++ b/modules/security/gopass/default.nix
@@ -95,7 +95,8 @@
$DRY_RUN_CMD cp -r $VERBOSE_ARG --no-preserve=mode ${./creation-templates} "${config.programs.password-store.settings.PASSWORD_STORE_DIR}/.gopass/create"
''
);
-
+ })
+ (lib.mkIf (config.security.gopass.enable && config.terminal.kitty.enable) {
xdg.desktopEntries."gopass" = {
name = "gopass";
exec = "${lib.getExe config.terminal.kitty.package} --class gopass -e ${lib.getExe config.security.gopass.package}";
@@ -106,7 +107,6 @@
type = "Application";
};
})
-
(lib.mkIf config.security.gopass.sync.enable {
home.activation.gopassSyncInit =
let
diff --git a/modules/security/gpg-tui/default.nix b/modules/security/gpg-tui/default.nix
index ea9364f..bc4ac4f 100644
--- a/modules/security/gpg-tui/default.nix
+++ b/modules/security/gpg-tui/default.nix
@@ -16,21 +16,24 @@
};
};
- config = lib.mkIf config.security.gpg-tui.enable {
- home.file.".local/share/icons/hicolor/scalable/apps/gpg.svg" = {
- source = ../../../assets/icons/apps/gpg.svg;
- };
-
- xdg.desktopEntries."gpg-tui" = {
- name = "gpg-tui";
- exec = "${lib.getExe config.terminal.kitty.package} --class gpg-tui -e ${lib.getExe config.security.gpg-tui.package}";
- icon = "gpg";
- categories = [ "Security" ];
- comment = "Terminal UI for GnuPG";
- terminal = false;
- type = "Application";
- };
+ config = lib.mkMerge [
+ (lib.mkIf config.security.gpg-tui.enable {
+ home.file.".local/share/icons/hicolor/scalable/apps/gpg.svg" = {
+ source = ../../../assets/icons/apps/gpg.svg;
+ };
- home.packages = [ config.security.gpg-tui.package ];
- };
+ home.packages = [ config.security.gpg-tui.package ];
+ })
+ (lib.mkIf (config.security.gpg-tui.enable && config.terminal.kitty.enable) {
+ xdg.desktopEntries."gpg-tui" = {
+ name = "gpg-tui";
+ exec = "${lib.getExe config.terminal.kitty.package} --class gpg-tui -e ${lib.getExe config.security.gpg-tui.package}";
+ icon = "gpg";
+ categories = [ "Security" ];
+ comment = "Terminal UI for GnuPG";
+ terminal = false;
+ type = "Application";
+ };
+ })
+ ];
}
diff --git a/modules/system/btop/default.nix b/modules/system/btop/default.nix
index 1f9a8d6..40f878f 100644
--- a/modules/system/btop/default.nix
+++ b/modules/system/btop/default.nix
@@ -21,24 +21,27 @@
};
};
- config = lib.mkIf config.system.btop.enable {
- programs.btop = {
- enable = true;
- package = config.system.btop.package;
- };
-
- xdg.desktopEntries."btop" = lib.mkIf config.terminal.kitty.enable {
- name = "btop++";
- exec = "${lib.getExe config.terminal.kitty.package} --class btop -e ${lib.getExe config.system.btop.package}";
- icon = "btop";
- categories = [
- "System"
- "Monitor"
- "ConsoleOnly"
- ];
- comment = "Cross-platform graphical process and system monitor";
- terminal = false;
- type = "Application";
- };
- };
+ config = lib.mkMerge [
+ (lib.mkIf config.system.btop.enable {
+ programs.btop = {
+ enable = true;
+ package = config.system.btop.package;
+ };
+ })
+ (lib.mkIf (config.system.btop.enable && config.terminal.kitty.enable) {
+ xdg.desktopEntries."btop" = {
+ name = "btop++";
+ exec = "${lib.getExe config.terminal.kitty.package} --class btop -e ${lib.getExe config.system.btop.package}";
+ icon = "btop";
+ categories = [
+ "System"
+ "Monitor"
+ "ConsoleOnly"
+ ];
+ comment = "Cross-platform graphical process and system monitor";
+ terminal = false;
+ type = "Application";
+ };
+ })
+ ];
}
diff --git a/modules/system/systemctl-tui/default.nix b/modules/system/systemctl-tui/default.nix
index 7483db6..17b7ec4 100644
--- a/modules/system/systemctl-tui/default.nix
+++ b/modules/system/systemctl-tui/default.nix
@@ -16,21 +16,24 @@
};
};
- config = lib.mkIf config.system.systemctl-tui.enable {
- home.file.".local/share/icons/hicolor/scalable/apps/systemd.svg" = {
- source = ../../../assets/icons/apps/systemd.svg;
- };
-
- xdg.desktopEntries."systemctl-tui" = {
- name = "systemctl-tui";
- exec = "${lib.getExe config.terminal.kitty.package} --class systemctl-tui -e ${lib.getExe config.system.systemctl-tui.package}";
- icon = "systemd";
- categories = [ "System" ];
- comment = "TUI for systemctl";
- terminal = false;
- type = "Application";
- };
+ config = lib.mkMerge [
+ (lib.mkIf config.system.systemctl-tui.enable {
+ home.file.".local/share/icons/hicolor/scalable/apps/systemd.svg" = {
+ source = ../../../assets/icons/apps/systemd.svg;
+ };
- home.packages = [ config.system.systemctl-tui.package ];
- };
+ home.packages = [ config.system.systemctl-tui.package ];
+ })
+ (lib.mkIf (config.system.systemctl-tui.enable && config.terminal.kitty.enable) {
+ xdg.desktopEntries."systemctl-tui" = {
+ name = "systemctl-tui";
+ exec = "${lib.getExe config.terminal.kitty.package} --class systemctl-tui -e ${lib.getExe config.system.systemctl-tui.package}";
+ icon = "systemd";
+ categories = [ "System" ];
+ comment = "TUI for systemctl";
+ terminal = false;
+ type = "Application";
+ };
+ })
+ ];
}
diff --git a/modules/web/chawan/default.nix b/modules/web/chawan/default.nix
index 2de49bd..f3f0a30 100644
--- a/modules/web/chawan/default.nix
+++ b/modules/web/chawan/default.nix
@@ -24,41 +24,45 @@
};
};
- config = lib.mkIf config.web.chawan.enable {
- home.file.".local/share/icons/hicolor/scalable/apps/internet-web-browser.svg" = {
- source = ../../../assets/icons/apps/internet-web-browser.svg;
- };
+ config = lib.mkMerge [
+ (lib.mkIf config.web.chawan.enable {
+ home.file.".local/share/icons/hicolor/scalable/apps/internet-web-browser.svg" = {
+ source = ../../../assets/icons/apps/internet-web-browser.svg;
+ };
- xdg.desktopEntries."chawan" = {
- name = "Chawan";
- exec = "${lib.getExe config.terminal.kitty.package} --class chawan -e ${lib.getExe config.web.chawan.package} ${config.web.chawan.homeUrl}";
- icon = "internet-web-browser";
- categories = [ "Network" ];
- comment = "Text-based web browser";
- terminal = false;
- type = "Application";
- };
- programs.chawan = {
- enable = true;
- settings = {
- buffer = {
- images = true;
- user-style = builtins.readFile ./user-style.css;
- };
- display = {
- image-mode = "auto";
- set-title = false;
- };
- network = {
- allow-http-from-file = true;
- };
- page = {
- o = ''() => pager.extern('xdg-open "$CHA_HOVER_URL"', {env: {CHA_HOVER_URL: pager.hoverLink}})'';
+ programs.chawan = {
+ enable = true;
+ settings = {
+ buffer = {
+ images = true;
+ user-style = builtins.readFile ./user-style.css;
+ };
+ display = {
+ image-mode = "auto";
+ set-title = false;
+ };
+ network = {
+ allow-http-from-file = true;
+ };
+ page = {
+ o = ''() => pager.extern('xdg-open "$CHA_HOVER_URL"', {env: {CHA_HOVER_URL: pager.hoverLink}})'';
+ };
};
};
- };
- home.packages = [
- config.web.chawan.package
- ];
- };
+ home.packages = [
+ config.web.chawan.package
+ ];
+ })
+ (lib.mkIf (config.web.chawan.enable && config.terminal.kitty.enable) {
+ xdg.desktopEntries."chawan" = {
+ name = "Chawan";
+ exec = "${lib.getExe config.terminal.kitty.package} --class chawan -e ${lib.getExe config.web.chawan.package} ${config.web.chawan.homeUrl}";
+ icon = "internet-web-browser";
+ categories = [ "Network" ];
+ comment = "Text-based web browser";
+ terminal = false;
+ type = "Application";
+ };
+ })
+ ];
}