ghostty: init (#703)

Link: https://github.com/danth/stylix/pull/703

Reviewed-by: NAHO <90870942+trueNAHO@users.noreply.github.com>
This commit is contained in:
Mirza Arnaut 2025-01-02 20:01:16 +01:00 committed by GitHub
parent 90f95c5d84
commit 6eb0597e34
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 81 additions and 6 deletions

12
flake.lock generated
View file

@ -142,11 +142,11 @@
]
},
"locked": {
"lastModified": 1733085484,
"narHash": "sha256-dVmNuUajnU18oHzBQWZm1BQtANCHaqNuxTHZQ+GN0r8=",
"lastModified": 1735774425,
"narHash": "sha256-C73gLFnEh8ZI0uDijUgCDWCd21T6I6tsaWgIBHcfAXg=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "c1fee8d4a60b89cae12b288ba9dbc608ff298163",
"rev": "5f6aa268e419d053c3d5025da740e390b12ac936",
"type": "github"
},
"original": {
@ -157,11 +157,11 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1732238832,
"narHash": "sha256-sQxuJm8rHY20xq6Ah+GwIUkF95tWjGRd1X8xF+Pkk38=",
"lastModified": 1735648875,
"narHash": "sha256-fQ4k/hyQiH9RRPznztsA9kbcDajvwV1sRm01el6Sr3c=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "8edf06bea5bcbee082df1b7369ff973b91618b8d",
"rev": "47e29c20abef74c45322eca25ca1550cdf5c3b50",
"type": "github"
},
"original": {

55
modules/ghostty/hm.nix Normal file
View file

@ -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;
};
};
};
}

View file

@ -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;
};
}
];
}