50 lines
1.2 KiB
Nix
50 lines
1.2 KiB
Nix
{
|
|
config,
|
|
lib,
|
|
pkgs,
|
|
...
|
|
}: let
|
|
inherit (lib.lists) elem;
|
|
inherit (lib.meta) getExe;
|
|
|
|
inherit (config.meta.mainUser.defaultShell) name package;
|
|
inherit (config.modules.style.colorScheme) slug;
|
|
|
|
# Shell integration for ghostty only supports
|
|
# bash, fish and zsh for now.
|
|
shell-integration =
|
|
if elem name ["bash" "fish" "zsh"]
|
|
then name
|
|
else "none";
|
|
|
|
ghostty-settings = pkgs.writeText "config" ''
|
|
font-family = JetBrainsMono Nerd Font Mono
|
|
window-padding-x = 8
|
|
window-padding-y = 8
|
|
background-opacity = 0.85
|
|
gtk-single-instance = true
|
|
font-size = 14
|
|
theme = ${slug}
|
|
resize-overlay-duration = 0s
|
|
cursor-style-blink = false
|
|
confirm-close-surface = false
|
|
copy-on-select = true
|
|
term = xterm-256color
|
|
|
|
shell-integration = ${shell-integration}
|
|
command = ${getExe package}
|
|
'';
|
|
|
|
ghostty-wrapped = pkgs.symlinkJoin {
|
|
name = "ghostty-wrapped";
|
|
paths = [pkgs.ghostty];
|
|
nativeBuildInputs = [pkgs.makeWrapper];
|
|
postBuild = ''
|
|
wrapProgram $out/bin/ghostty --add-flags "--config-file=${ghostty-settings}"
|
|
'';
|
|
};
|
|
in {
|
|
environment.systemPackages = builtins.attrValues {
|
|
inherit ghostty-wrapped;
|
|
};
|
|
}
|