aboutsummaryrefslogtreecommitdiffstats
path: root/modules/tools/terminal
diff options
context:
space:
mode:
authorArpit Chakladar <54011232+arpitchakladar@users.noreply.github.com>2024-10-12 01:23:54 +0530
committerArpit Chakladar <54011232+arpitchakladar@users.noreply.github.com>2024-10-12 01:23:54 +0530
commit15f26a50e9df70a2c8ef4bcc8550d0e4121ba6f4 (patch)
tree21cedb4ec44542520dd5847772a20342ac82977d /modules/tools/terminal
parent35563f4b7c2e9a5ff8c58af6b0352ff1d88e7c02 (diff)
downloadhome-manager-config-15f26a50e9df70a2c8ef4bcc8550d0e4121ba6f4.tar.gz
home-manager-config-15f26a50e9df70a2c8ef4bcc8550d0e4121ba6f4.zip
Using desktop background.
Using window transparency with picom. Using alacritty because kitty is having problems with colors when picom is running.
Diffstat (limited to 'modules/tools/terminal')
-rw-r--r--modules/tools/terminal/alacritty/default.nix83
-rw-r--r--modules/tools/terminal/default.nix23
-rw-r--r--modules/tools/terminal/kitty/default.nix61
3 files changed, 167 insertions, 0 deletions
diff --git a/modules/tools/terminal/alacritty/default.nix b/modules/tools/terminal/alacritty/default.nix
new file mode 100644
index 0000000..4bffc0b
--- /dev/null
+++ b/modules/tools/terminal/alacritty/default.nix
@@ -0,0 +1,83 @@
+{ pkgs, config, lib, ... }:
+
+{
+ options.tools.terminal.alacritty = {
+ enable = lib.mkEnableOption "Enables alacritty.";
+ };
+
+ config = lib.mkIf config.tools.terminal.alacritty.enable {
+ programs.alacritty.enable = true;
+ tools.terminal.default = lib.mkDefault "alacritty";
+ tools.terminal.command =
+ if config.tools.terminal.default == "alacritty" then
+ lib.mkForce "${pkgs.kitty}/bin/alacritty"
+ else "";
+
+ programs.alacritty.settings = {
+ window = {
+ opacity = 1.0;
+ padding = {
+ x = config.desktop.window-manager.gap;
+ y = config.desktop.window-manager.gap;
+ };
+ decorations = "none";
+ };
+
+ font = {
+ normal = {
+ family = config.fonts.normal;
+ style = "Retina";
+ };
+ bold = {
+ family = config.fonts.bold;
+ style = "Bold";
+ };
+ italic = {
+ family = config.fonts.italic;
+ };
+ size = config.fonts.size;
+ };
+
+ colors = with config.scheme; {
+ primary = {
+ background = "0x${base00}";
+ foreground = "0x${base05}";
+ };
+ normal = {
+ black = "0x${base00}";
+ red = "0x${base08}";
+ green = "0x${base0B}";
+ yellow = "0x${base0A}";
+ blue = "0x${base0D}";
+ magenta = "0x${base0E}";
+ cyan = "0x${base0C}";
+ white = "0x${base05}";
+ };
+ bright = {
+ black = "0x${base03}";
+ red = "0x${base08}";
+ green = "0x${base0B}";
+ yellow = "0x${base0A}";
+ blue = "0x${base0D}";
+ magenta = "0x${base0E}";
+ cyan = "0x${base0C}";
+ white = "0x${base07}";
+ };
+ dim = {
+ black = "0x${base01}";
+ red = "0x${base08}";
+ green = "0x${base0B}";
+ yellow = "0x${base0A}";
+ blue = "0x${base0D}";
+ magenta = "0x${base0E}";
+ cyan = "0x${base0C}";
+ white = "0x${base04}";
+ };
+ };
+
+ shell = {
+ program = config.shell.command;
+ };
+ };
+ };
+}
diff --git a/modules/tools/terminal/default.nix b/modules/tools/terminal/default.nix
new file mode 100644
index 0000000..b9038e0
--- /dev/null
+++ b/modules/tools/terminal/default.nix
@@ -0,0 +1,23 @@
+{ lib, ... }:
+
+{
+ imports = [
+ ./alacritty
+ ./kitty
+ ];
+
+ options.tools.terminal = {
+ command = lib.mkOption {
+ type = lib.types.str;
+ description = "Command for the terminal.";
+ };
+
+ default = lib.mkOption {
+ type = lib.types.enum [
+ "kitty"
+ "alacritty"
+ ];
+ description = "Default terminal.";
+ };
+ };
+}
diff --git a/modules/tools/terminal/kitty/default.nix b/modules/tools/terminal/kitty/default.nix
new file mode 100644
index 0000000..5508feb
--- /dev/null
+++ b/modules/tools/terminal/kitty/default.nix
@@ -0,0 +1,61 @@
+{ pkgs, config, lib, ... }:
+
+{
+ options.tools.terminal.kitty = {
+ enable = lib.mkEnableOption "Enables kitty. WARNING! Currently faces problems with color rendering with picom.";
+ };
+
+ config = lib.mkIf config.tools.terminal.kitty.enable {
+ assertions = [
+ {
+ assertion = config.desktop.xdg-portal.enable;
+ message ="Module tools.terminal.kitty requires desktop.xdg-portal module to be enabled.";
+ }
+ ];
+ programs.kitty.enable = true;
+ tools.terminal.default = lib.mkDefault "kitty";
+ tools.terminal.command =
+ if config.tools.terminal.default == "kitty" then
+ lib.mkForce "${pkgs.kitty}/bin/kitty"
+ else "";
+
+ programs.kitty.settings = with config.scheme.withHashtag; {
+ window_padding_width = config.desktop.window-manager.gap;
+ font_size = config.fonts.size;
+ font_family = config.fonts.normal;
+ filter_notification = "all";
+ update_check_interval = 0; # disable notifications
+ scrollback_indicator_opacity = "0.5";
+
+ dynamic_background_opacity = false;
+ allow_remote_control = false;
+ enable_audio_bell = false;
+
+ background = base00;
+ foreground = base05;
+ text_composition_strategy = "legacy";
+
+ color0 = base00; # Black
+ color8 = base00; # Black
+ color1 = base08; # Red
+ color9 = base08; # Red
+ color2 = base0B; # Green
+ color10 = base0B; # Green
+ color3 = base0A; # Yellow
+ color11 = base0A; # Yellow
+ color4 = base0D; # Blue
+ color12 = base0D; # Blue
+ color5 = base0E; # Magenta
+ color13 = base0E; # Magenta
+ color6 = base0C; # Cyan
+ color14 = base0C; # Cyan
+ color7 = base05; # White
+ color15 = base05; # White
+
+ selection_background = base03;
+ selection_foreground = base00;
+
+ shell = config.shell.command;
+ };
+ };
+}