summaryrefslogtreecommitdiff
path: root/common/modules/terminal
diff options
context:
space:
mode:
Diffstat (limited to 'common/modules/terminal')
-rw-r--r--common/modules/terminal/alacritty.nix46
-rw-r--r--common/modules/terminal/default.nix72
-rw-r--r--common/modules/terminal/foot.nix33
-rw-r--r--common/modules/terminal/ghostty.nix54
4 files changed, 205 insertions, 0 deletions
diff --git a/common/modules/terminal/alacritty.nix b/common/modules/terminal/alacritty.nix
new file mode 100644
index 0000000..09cb54f
--- /dev/null
+++ b/common/modules/terminal/alacritty.nix
@@ -0,0 +1,46 @@
+{
+ lib,
+ config,
+}:
+let
+ cfg = config.beeMods.terminal;
+in
+{
+ config = lib.mkIf cfg.alacritty {
+ programs.alacritty = {
+ enable = true;
+ settings = {
+ cursor = {
+ thickness = 0.0;
+ };
+ debug = {
+ prefer_egl = true;
+ };
+ colors = {
+ draw_bold_text_with_bright_colors = cfg.font.bright_color_is_bold;
+ };
+ mouse = {
+ hide_when_typing = true;
+ };
+ general = {
+ import = lib.optionals config.beeMods.matugen.enable [ "~/.config/alacritty/colors.toml" ];
+ };
+ window = {
+ dynamic_padding = true;
+ padding = {
+ y = cfg.window.padding-y;
+ x = cfg.window.padding-x;
+ };
+ dimensions = {
+ lines = 75;
+ columns = 100;
+ };
+ };
+ font = {
+ normal.family = cfg.font.family;
+ size = cfg.font.size;
+ };
+ };
+ };
+ };
+}
diff --git a/common/modules/terminal/default.nix b/common/modules/terminal/default.nix
new file mode 100644
index 0000000..b8f97c2
--- /dev/null
+++ b/common/modules/terminal/default.nix
@@ -0,0 +1,72 @@
+{
+ homeManager,
+ inputs,
+ moduleNameSpace,
+ ...
+}:
+{
+ config,
+ lib,
+ pkgs,
+ ...
+}:
+with lib;
+let
+ cfg = config.${moduleNameSpace}.terminal;
+in
+{
+ imports = [
+ (import ./foot.nix { inherit lib config; })
+ (import ./ghostty.nix { inherit lib config; })
+ (import ./alacritty.nix { inherit lib config; })
+ ];
+
+ options.${moduleNameSpace}.terminal = {
+ default = mkOption {
+ type = types.enum [
+ "foot"
+ "ghostty"
+ "alacritty"
+ ];
+ default = "foot";
+ description = "The terminal emulator to enable.";
+ };
+ foot = mkEnableOption "enable foot";
+ alacritty = mkEnableOption "enable alacritty";
+ ghostty = mkEnableOption "enable ghostty";
+
+ font = {
+ family = mkOption {
+ type = types.str;
+ default = "monospace";
+ };
+
+ size = mkOption {
+ type = types.float;
+ default = 13.0;
+ };
+
+ bright_color_is_bold = mkOption {
+ type = types.bool;
+ default = false;
+ description = "Force bold text";
+ };
+
+ ligatures = mkEnableOption "Only supported by ghostty";
+ };
+
+ window = {
+ padding-x = mkOption {
+ type = types.int;
+ default = 10;
+ description = "Window padding x axis (pixels).";
+ };
+
+ padding-y = mkOption {
+ type = types.int;
+ default = 10;
+ description = "Window padding y axis (pixels).";
+ };
+ };
+ };
+}
diff --git a/common/modules/terminal/foot.nix b/common/modules/terminal/foot.nix
new file mode 100644
index 0000000..a804815
--- /dev/null
+++ b/common/modules/terminal/foot.nix
@@ -0,0 +1,33 @@
+{
+ lib,
+ config,
+}:
+let
+ cfg = config.beeMods.terminal;
+in
+{
+ config = lib.mkIf cfg.foot {
+ programs.foot = {
+ enable = true;
+ settings = {
+ main = {
+ include = lib.optionals config.beeMods.matugen.enable [ "~/.config/foot/colors.ini" ];
+
+ pad = "${toString cfg.window.padding-x}x${toString cfg.window.padding-y} center";
+ font = "${cfg.font.family}:size=${toString cfg.font.size}";
+
+ dpi-aware = "no";
+ gamma-correct-blending = "yes";
+ bold-text-in-bright = if cfg.font.bright_color_is_bold then "yes" else "no";
+ };
+ cursor = {
+ beam-thickness = 1;
+ };
+ mouse = {
+ hide-when-typing = "yes";
+ };
+ key-bindings = { };
+ };
+ };
+ };
+}
diff --git a/common/modules/terminal/ghostty.nix b/common/modules/terminal/ghostty.nix
new file mode 100644
index 0000000..4a6277e
--- /dev/null
+++ b/common/modules/terminal/ghostty.nix
@@ -0,0 +1,54 @@
+{
+ lib,
+ config,
+}:
+let
+ cfg = config.beeMods.terminal;
+in
+{
+ config = lib.mkIf cfg.ghostty {
+ programs.ghostty = {
+ enable = true;
+ enableFishIntegration = true;
+ settings = {
+ config-file = lib.optionals config.beeMods.matugen.enable [ "~/.config/ghostty/colors.conf" ];
+
+ font-family = cfg.font.family;
+ font-size = cfg.font.size;
+ alpha-blending = "liner";
+ window-padding-x = cfg.window.padding-x;
+ window-padding-y = cfg.window.padding-y;
+ font-feature = [
+ "cv10"
+ "cv06"
+ "ss02"
+ "ss03"
+ ]
+ ++ (
+ if cfg.font.ligatures then
+ [
+ "calt"
+ "liga"
+ "dlig"
+ ]
+ else
+ [
+ "-calt"
+ "-liga"
+ "-dlig"
+ ]
+ );
+ bold-is-bright = cfg.font.bright_color_is_bold;
+ gtk-titlebar = false;
+ gtk-single-instance = true;
+ gtk-tabs-location = "bottom";
+ gtk-wide-tabs = false;
+ resize-overlay = "never";
+ copy-on-select = false;
+ confirm-close-surface = false;
+ mouse-hide-while-typing = true;
+ window-inherit-working-directory = false;
+ };
+ };
+ };
+}