Conversation
2dd68b0 to
ed3ecd5
Compare
|
You could also look at module options adding the vim/bat plugins that ship with ghostty. In https://github.com/clo4/ghostty-hm-module @clo4 might have additional insight to share |
programs.bat = {
syntaxes = {
ghostty = {
src = ghostty;
file = "share/bat/syntaxes/ghostty.sublime-syntax";
};
};
config = {
map-syntax = [ "*/ghostty/config:Ghostty Config" ];
# or more explicit
# map-syntax = [ "${config.xdg.configHome}/ghostty/config:Ghostty Config" ];
};
};
programs.vim.plugins = [
ghostty.vim
]; |
Didn't knew this was a thing, I will look into it. |
e69e746 to
6cfb651
Compare
|
Maybe I am missing something, but I am not sure how to add keybindings using the config... |
{
programs.ghostty.settings = {
keybind = [
"clear"
"ctrl+h=goto_split:left"
"ctrl+l=goto_split:right"
# etc.
];
};
}If this doesn't work for you right now, maybe you should update the input.I wouldn't really like to create an option solely for keybindings, because I don't think it is really needed. My only concern is the |
|
ghostty-org/ghostty#3203 has a good summary explanation for the config format. |
Fair enough, I just came up at the same solution! Thanks tho! |
6cfb651 to
2af5fa5
Compare
|
Added a option for prepending |
|
wow! i was starting to implement this module! awesome! now question i have is: I don't know how home-manager aims to tackle this or if there's a standard, but some module have extensive nix options representing actual settings items and others have a generic 'settings' option that receive a raw string while others have a mix of 'native' options in addition to the extraConfig option. based in the standard (or not), does it make sense to try to implement native options in nix for the Ghostty settings? I could tackle this in another pr if this is the case. wdyt? |
There is a standard: RFC 0042, which is what I’m following for this PR. But yeah, not all modules implement it.
Technically, I could create a submodule to map out all the Ghostty options and then add a That said, there are cases where mapping options is worth it, like if the upstream project doesn’t have proper documentation for their settings. But that’s not the case with Ghostty, they’ve got a solid configuration reference |
|
I got feedback on my PR for adding ghostty to stylix. One question was if there was a way to configure custom themes using the HM module. AFAIK the theme can only be set, but not provided. Are there any plans on adding this feature in this PR, or should I open up a new one when this one gets merged? |
I will add an option to add themes |
2af5fa5 to
4a94595
Compare
|
@arunoruto added themes option |
rycee
left a comment
There was a problem hiding this comment.
Thanks for the contribution! Looks good in general, I've just added a few minor comments.
4a94595 to
07fcc43
Compare
|
May want to add an option for an ssh terminfo work around. Named to indicate it's a work around. See https://ghostty.org/docs/help/terminfo#ssh (there could be better ways to address this) programs.ssh = {
matchBlocks = {
"*" = {
extraOptions = {
SetEnv = "TERM=xterm-256color";
};
};
};
}; |
|
Could also include shell-integration flags following the manual integration steps here: https://ghostty.org/docs/help/terminfo#ssh. Similar to kitty, though I don't think you need the extra mangling they to to set |
4c49e96 to
2a80e8a
Compare
|
Some updates:
|
I would like to mark it as ready after flake.lock gets updated, #6240 updates it, but still in a older version of nixos-unstable. |
|
I think rycee or someone could manually trigger the flake update workflow, otherwise you'll have to wait until Wednesday and then for a merge |
2a80e8a to
948186d
Compare
|
For the vim syntax: adding |
948186d to
a04324b
Compare
I completely forgot that vim handles things differently, re-added the option exclusively for vim |
a04324b to
1c73f61
Compare
|
Thanks! Merged to master now 🙂 |
|
Does this have nushell integration? |
Ghostty does not provide a nushell integration according to their docs |
|
Not currently no. See https://github.com/ghostty-org/ghostty/tree/main/src/shell-integration and perhaps https://github.com/ghostty-org/ghostty/pull/1772/files / https://github.com/ghostty-org/ghostty/pull/1774/files as a sketch pr for adding a new shell. (elvish was added later as a couple changes) |
Some shells such as Nushell have built-in support for some of the features that Ghostty provides, so shell integration is not necessary. This is what they have in their documentation |
|
This module does break when |
Could you provide the error for me? I have bat enabled in my configuration, and it didn't fail to build, last time I updated my configuration |
Relevant configs: |
|
I see you are on macOS, so my guess is that the bat syntax file is not available in the darwin package for some reason, and looks like the package got marked again as broken on darwin |
Description
Adds a module for ghostty terminal emulator, depends on NixOS/nixpkgs#368404
Closes #6236
Checklist
Change is backwards compatible.
Code formatted with
./format.Code tested through
nix-shell --pure tests -A run.allornix develop --ignore-environment .#allusing Flakes.Test cases updated/added. See example.
Commit messages are formatted like
See CONTRIBUTING for more information and recent commit messages for examples.
If this PR adds a new module
Maintainer CC