modules: ghostty: init
This commit is contained in:
parent
362e52b874
commit
64adfc6ea4
1 changed files with 47 additions and 0 deletions
47
modules/programs/gui/ghostty/module.nix
Normal file
47
modules/programs/gui/ghostty/module.nix
Normal file
|
@ -0,0 +1,47 @@
|
|||
{
|
||||
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
|
||||
|
||||
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;
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue