aboutsummaryrefslogtreecommitdiff
path: root/home-manager/modules/programs/termite.nix
diff options
context:
space:
mode:
Diffstat (limited to 'home-manager/modules/programs/termite.nix')
-rw-r--r--home-manager/modules/programs/termite.nix157
1 files changed, 83 insertions, 74 deletions
diff --git a/home-manager/modules/programs/termite.nix b/home-manager/modules/programs/termite.nix
index a5b1cebe775..8a05db03558 100644
--- a/home-manager/modules/programs/termite.nix
+++ b/home-manager/modules/programs/termite.nix
@@ -13,9 +13,7 @@ let
fi
'';
-in
-
-{
+in {
options = {
programs.termite = {
enable = mkEnableOption "Termite VTE-based terminal";
@@ -61,7 +59,9 @@ in
mouseAutohide = mkOption {
default = null;
type = types.nullOr types.bool;
- description = "Automatically hide the mouse pointer when you start typing.";
+ description = ''
+ Automatically hide the mouse pointer when you start typing.
+ '';
};
scrollOnOutput = mkOption {
@@ -73,7 +73,9 @@ in
scrollOnKeystroke = mkOption {
default = null;
type = types.nullOr types.bool;
- description = "Scroll to the bottom automatically when a key is pressed.";
+ description = ''
+ Scroll to the bottom automatically when a key is pressed.
+ '';
};
searchWrap = mkOption {
@@ -106,14 +108,16 @@ in
default = null;
example = "terminal";
type = types.nullOr types.str;
- description = "The name of the icon to be used for the terminal process.";
+ description =
+ "The name of the icon to be used for the terminal process.";
};
scrollbackLines = mkOption {
default = null;
example = 10000;
type = types.nullOr types.int;
- description = "Set the number of lines to limit the terminal's scrollback.";
+ description =
+ "Set the number of lines to limit the terminal's scrollback.";
};
browser = mkOption {
@@ -149,7 +153,8 @@ in
filterUnmatchedUrls = mkOption {
default = null;
type = types.nullOr types.bool;
- description = "Whether to hide url hints not matching input in url hints mode.";
+ description =
+ "Whether to hide url hints not matching input in url hints mode.";
};
modifyOtherKeys = mkOption {
@@ -178,7 +183,7 @@ in
scrollbar = mkOption {
default = null;
type = types.nullOr (types.enum [ "off" "left" "right" ]);
- description = "Scroll to the bottom when the shell generates output.";
+ description = "Scrollbar position.";
};
backgroundColor = mkOption {
@@ -290,7 +295,8 @@ in
default = "";
example = "fullscreen = true";
type = types.lines;
- description = "Extra options that should be added to [options] section.";
+ description =
+ "Extra options that should be added to [options] section.";
};
colorsExtra = mkOption {
@@ -301,78 +307,81 @@ in
color2 = #60b48a
'';
type = types.lines;
- description = "Extra colors options that should be added to [colors] section.";
+ description =
+ "Extra colors options that should be added to [colors] section.";
};
hintsExtra = mkOption {
default = "";
example = "border = #3f3f3f";
type = types.lines;
- description = "Extra hints options that should be added to [hints] section.";
+ description =
+ "Extra hints options that should be added to [hints] section.";
};
};
};
- config = (
- let
- boolToString = v: if v then "true" else "false";
- optionalBoolean = name: val: lib.optionalString (val != null) "${name} = ${boolToString val}";
- optionalInteger = name: val: lib.optionalString (val != null) "${name} = ${toString val}";
- optionalString = name: val: lib.optionalString (val != null) "${name} = ${val}";
- in mkIf cfg.enable {
- home.packages = [ pkgs.termite ];
- xdg.configFile."termite/config".text = ''
- [options]
- ${optionalBoolean "allow_bold" cfg.allowBold}
- ${optionalBoolean "audible_bell" cfg.audibleBell}
- ${optionalString "browser" cfg.browser}
- ${optionalBoolean "clickable_url" cfg.clickableUrl}
- ${optionalString "cursor_blink" cfg.cursorBlink}
- ${optionalString "cursor_shape" cfg.cursorShape}
- ${optionalBoolean "dynamic_title" cfg.dynamicTitle}
- ${optionalBoolean "filter_unmatched_urls" cfg.filterUnmatchedUrls}
- ${optionalString "font" cfg.font}
- ${optionalBoolean "fullscreen" cfg.fullscreen}
- ${optionalString "geometry" cfg.geometry}
- ${optionalString "icon_name" cfg.iconName}
- ${optionalBoolean "modify_other_keys" cfg.modifyOtherKeys}
- ${optionalBoolean "mouse_autohide" cfg.mouseAutohide}
- ${optionalBoolean "scroll_on_keystroke" cfg.scrollOnKeystroke}
- ${optionalBoolean "scroll_on_output" cfg.scrollOnOutput}
- ${optionalInteger "scrollback_lines" cfg.scrollbackLines}
- ${optionalString "scrollbar" cfg.scrollbar}
- ${optionalBoolean "search_wrap" cfg.searchWrap}
- ${optionalBoolean "size_hints" cfg.sizeHints}
- ${optionalBoolean "urgent_on_bell" cfg.urgentOnBell}
-
- ${cfg.optionsExtra}
-
- [colors]
- ${optionalString "background" cfg.backgroundColor}
- ${optionalString "cursor" cfg.cursorColor}
- ${optionalString "cursor_foreground" cfg.cursorForegroundColor}
- ${optionalString "foreground" cfg.foregroundColor}
- ${optionalString "foregroundBold" cfg.foregroundBoldColor}
- ${optionalString "highlight" cfg.highlightColor}
-
- ${cfg.colorsExtra}
-
- [hints]
- ${optionalString "active_background" cfg.hintsActiveBackgroundColor}
- ${optionalString "active_foreground" cfg.hintsActiveForegroundColor}
- ${optionalString "background" cfg.hintsBackgroundColor}
- ${optionalString "border" cfg.hintsBorderColor}
- ${optionalInteger "border_width" cfg.hintsBorderWidth}
- ${optionalString "font" cfg.hintsFont}
- ${optionalString "foreground" cfg.hintsForegroundColor}
- ${optionalInteger "padding" cfg.hintsPadding}
- ${optionalInteger "roundness" cfg.hintsRoundness}
-
- ${cfg.hintsExtra}
- '';
-
- programs.bash.initExtra = vteInitStr;
- programs.zsh.initExtra = vteInitStr;
- }
- );
+ config = (let
+ boolToString = v: if v then "true" else "false";
+ optionalBoolean = name: val:
+ lib.optionalString (val != null) "${name} = ${boolToString val}";
+ optionalInteger = name: val:
+ lib.optionalString (val != null) "${name} = ${toString val}";
+ optionalString = name: val:
+ lib.optionalString (val != null) "${name} = ${val}";
+ in mkIf cfg.enable {
+ home.packages = [ pkgs.termite ];
+ xdg.configFile."termite/config".text = ''
+ [options]
+ ${optionalBoolean "allow_bold" cfg.allowBold}
+ ${optionalBoolean "audible_bell" cfg.audibleBell}
+ ${optionalString "browser" cfg.browser}
+ ${optionalBoolean "clickable_url" cfg.clickableUrl}
+ ${optionalString "cursor_blink" cfg.cursorBlink}
+ ${optionalString "cursor_shape" cfg.cursorShape}
+ ${optionalBoolean "dynamic_title" cfg.dynamicTitle}
+ ${optionalBoolean "filter_unmatched_urls" cfg.filterUnmatchedUrls}
+ ${optionalString "font" cfg.font}
+ ${optionalBoolean "fullscreen" cfg.fullscreen}
+ ${optionalString "geometry" cfg.geometry}
+ ${optionalString "icon_name" cfg.iconName}
+ ${optionalBoolean "modify_other_keys" cfg.modifyOtherKeys}
+ ${optionalBoolean "mouse_autohide" cfg.mouseAutohide}
+ ${optionalBoolean "scroll_on_keystroke" cfg.scrollOnKeystroke}
+ ${optionalBoolean "scroll_on_output" cfg.scrollOnOutput}
+ ${optionalInteger "scrollback_lines" cfg.scrollbackLines}
+ ${optionalString "scrollbar" cfg.scrollbar}
+ ${optionalBoolean "search_wrap" cfg.searchWrap}
+ ${optionalBoolean "size_hints" cfg.sizeHints}
+ ${optionalBoolean "urgent_on_bell" cfg.urgentOnBell}
+
+ ${cfg.optionsExtra}
+
+ [colors]
+ ${optionalString "background" cfg.backgroundColor}
+ ${optionalString "cursor" cfg.cursorColor}
+ ${optionalString "cursor_foreground" cfg.cursorForegroundColor}
+ ${optionalString "foreground" cfg.foregroundColor}
+ ${optionalString "foregroundBold" cfg.foregroundBoldColor}
+ ${optionalString "highlight" cfg.highlightColor}
+
+ ${cfg.colorsExtra}
+
+ [hints]
+ ${optionalString "active_background" cfg.hintsActiveBackgroundColor}
+ ${optionalString "active_foreground" cfg.hintsActiveForegroundColor}
+ ${optionalString "background" cfg.hintsBackgroundColor}
+ ${optionalString "border" cfg.hintsBorderColor}
+ ${optionalInteger "border_width" cfg.hintsBorderWidth}
+ ${optionalString "font" cfg.hintsFont}
+ ${optionalString "foreground" cfg.hintsForegroundColor}
+ ${optionalInteger "padding" cfg.hintsPadding}
+ ${optionalInteger "roundness" cfg.hintsRoundness}
+
+ ${cfg.hintsExtra}
+ '';
+
+ programs.bash.initExtra = vteInitStr;
+ programs.zsh.initExtra = vteInitStr;
+ });
}