nichts/modules/home/programs/ghostty.hjem.nix

70 lines
1.8 KiB
Nix
Raw Normal View History

2025-06-12 20:09:05 +02:00
{
lib,
osConfig,
2025-06-12 20:09:05 +02:00
pkgs,
...
}:
let
2025-06-12 20:09:05 +02:00
inherit (lib.lists) elem;
inherit (lib.meta) getExe;
2025-07-03 23:34:56 +02:00
inherit (lib.attrsets) mapAttrsToList;
inherit (lib.strings) concatStringsSep;
2025-06-12 20:09:05 +02:00
inherit (osConfig.meta.mainUser.defaultShell) name package;
2025-06-12 20:09:05 +02:00
# Shell integration for ghostty only supports
# bash, fish and zsh for now.
shell-integration =
if
elem name [
"bash"
"fish"
"zsh"
]
then
name
else
"none";
2025-06-12 20:09:05 +02:00
2025-07-03 23:34:56 +02:00
ghostty-settings = {
font-size = 14;
2025-07-13 22:51:22 +02:00
font-family = "JetBrainsMonoNerdFont";
2025-06-12 20:09:05 +02:00
2025-07-13 22:51:22 +02:00
app-notifications = "no-clipboard-copy";
background-opacity = 0.7;
2025-07-13 22:51:22 +02:00
bold-is-bright = "true";
confirm-close-surface = "false";
cursor-style-blink = "false";
2025-07-03 23:34:56 +02:00
gtk-single-instance = "true";
gtk-tabs-location = "bottom";
gtk-wide-tabs = false;
mouse-hide-while-typing = "true";
2025-07-13 22:51:22 +02:00
resize-overlay-duration = "0s";
2025-07-03 23:34:56 +02:00
shell-integration-features = "cursor,sudo,no-title";
2025-07-13 22:51:22 +02:00
term = "xterm-256color";
theme = "nightfox";
2025-07-13 22:51:22 +02:00
window-decoration = "none";
window-padding-balance = true;
window-padding-x = 8;
window-padding-y = 8;
window-theme = "ghostty";
2025-07-03 23:34:56 +02:00
cursor-style = "block";
# Whether to automatically copy selected text to the clipboard. true will prefer to copy to the selection clipboard, otherwise it will copy to the system clipboard.
# The value clipboard will always copy text to the selection clipboard as well as the system clipboard.
copy-on-select = "clipboard";
2025-07-08 13:57:04 +02:00
inherit shell-integration;
2025-07-13 22:51:22 +02:00
2025-07-03 23:34:56 +02:00
command = getExe package;
};
in
{
packages = builtins.attrValues {
inherit (pkgs) ghostty;
2025-06-12 20:09:05 +02:00
};
files.".config/ghostty/config".text =
concatStringsSep "\n"
<| mapAttrsToList (name: value: "${name} = ${toString value}") ghostty-settings;
2025-06-12 20:09:05 +02:00
}