From 808efee1c2c13b52108bb19d753dd883dcaf158c Mon Sep 17 00:00:00 2001 From: jmug Date: Sun, 1 Jun 2025 21:05:43 -0700 Subject: [PATCH] Parametrize ghostty. Signed-off-by: jmug --- home-modules/ghostty-config.nix | 19 ++++++++++++++----- hosts/asahi/home.nix | 3 +++ 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/home-modules/ghostty-config.nix b/home-modules/ghostty-config.nix index 005f122..1e424c1 100644 --- a/home-modules/ghostty-config.nix +++ b/home-modules/ghostty-config.nix @@ -1,20 +1,29 @@ -{ ... }: { - home.file.".config/ghostty/config" = { +{ lib, config, ... }: { + options.ghostty.font-size = lib.mkOption { + # Using a string to support floats. + type = lib.types.str; + default = "12"; # Set your default integer value here + description = "Font size to be used within ghostty"; + }; + + options.ghostty.window-decoration = lib.mkEnableOption "window-decoration"; + + config.home.file.".config/ghostty/config" = { text = '' # If not preset, this causes issues when sshing into linux servers. term = xterm-256color font-family = "BigBlueTermPlus Nerd Font" - font-size = 17.2 + font-size = ${config.ghostty.font-size} theme = "PaleNight" background-opacity = 0.9 - window-decoration = false + window-decoration = ${if config.ghostty.window-decoration then "true" else "false" } # This is the default to open the configuration # I type this by accident way to frequently... keybind = ctrl+comma=unbind ''; }; - home.file.".config/ghostty/themes/PaleNight" = { + config.home.file.".config/ghostty/themes/PaleNight" = { text = '' palette = 0=#000000 palette = 1=#ff5555 diff --git a/hosts/asahi/home.nix b/hosts/asahi/home.nix index 3c38780..7d35d9e 100644 --- a/hosts/asahi/home.nix +++ b/hosts/asahi/home.nix @@ -22,6 +22,9 @@ in inputs.walker.homeManagerModules.default ]; + ghostty.font-size = "14"; + ghostty.window-decoration = false; + home = { username = "jmug"; homeDirectory = "/home/jmug";