Skip to content

Commit

Permalink
ghostty: init (#703)
Browse files Browse the repository at this point in the history
Link: #703

Reviewed-by: NAHO <[email protected]>
  • Loading branch information
arunoruto authored Jan 2, 2025
1 parent 90f95c5 commit 6eb0597
Show file tree
Hide file tree
Showing 3 changed files with 81 additions and 6 deletions.
12 changes: 6 additions & 6 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

55 changes: 55 additions & 0 deletions modules/ghostty/hm.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Documentation is available at:
# - https://ghostty.org/docs/config/reference
# - `man 5 ghostty`
{ config, lib, ... }:
{
options.stylix.targets.ghostty.enable = config.lib.stylix.mkEnableTarget "Ghostty" true;

config = lib.mkIf (config.stylix.enable && config.stylix.targets.ghostty.enable) {
programs.ghostty = {
settings =
let
inherit (config.stylix) fonts opacity;
in
{
theme = "stylix";
font-family = [
fonts.monospace.name
fonts.emoji.name
];
font-size = fonts.sizes.terminal;
background-opacity = opacity.terminal;
};
themes.stylix =
let
inherit (config.lib.stylix) colors;
inherit (config.lib.stylix.colors) withHashtag;
in
{
palette = [
"0=${withHashtag.base03}"
"1=${withHashtag.base08}"
"2=${withHashtag.base0B}"
"3=${withHashtag.base0A}"
"4=${withHashtag.base0D}"
"5=${withHashtag.base0F}"
"6=${withHashtag.base0C}"
"7=${withHashtag.base05}"
"8=${withHashtag.base04}"
"9=${withHashtag.base08}"
"10=${withHashtag.base0B}"
"11=${withHashtag.base0A}"
"12=${withHashtag.base0D}"
"13=${withHashtag.base0F}"
"14=${withHashtag.base0C}"
"15=${withHashtag.base05}"
];
background = colors.base00;
foreground = colors.base05;
cursor-color = colors.base06;
selection-background = colors.base02;
selection-foreground = colors.base05;
};
};
};
}
20 changes: 20 additions & 0 deletions modules/ghostty/testbed.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{ pkgs, ... }:
let
package = pkgs.ghostty;
in
{
stylix.testbed.application = {
enable = true;
name = "com.mitchellh.ghostty";
inherit package;
};

home-manager.sharedModules = [
{
programs.ghostty = {
enable = true;
inherit package;
};
}
];
}

0 comments on commit 6eb0597

Please sign in to comment.