-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
it could be removed when the module is backported to nix-community/home-manager/release-24.11
- Loading branch information
1 parent
288364c
commit e43915b
Showing
6 changed files
with
97 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
{ | ||
imports = [ | ||
./ghostty.nix | ||
./kbdd.nix | ||
./polybar-program.nix | ||
./thermal-zone.nix | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
{ | ||
pkgs, | ||
config, | ||
inputs, | ||
lib, | ||
... | ||
}: | ||
let | ||
cfg = config.programs.ghostty; | ||
keyValueSettings = { | ||
listsAsDuplicateKeys = true; | ||
mkKeyValue = lib.generators.mkKeyValueDefault { } " = "; | ||
}; | ||
keyValue = pkgs.formats.keyValue keyValueSettings; | ||
in | ||
{ | ||
options.programs.ghostty = { | ||
enable = lib.mkEnableOption "Enable ghostty"; | ||
package = lib.mkOption { | ||
type = lib.types.package; | ||
default = | ||
let | ||
ghosttyPkgs = builtins.getAttr pkgs.hostPlatform.system inputs.ghostty.packages; | ||
in | ||
ghosttyPkgs.ghostty; | ||
defaultText = lib.literalExpression "pkgs.ghostty"; | ||
description = '' | ||
Ghostty package to install. | ||
''; | ||
}; | ||
settings = lib.mkOption { | ||
inherit (keyValue) type; | ||
default = | ||
let | ||
inherit (config.stylix) fonts opacity; | ||
inherit (config.lib.stylix) scheme; | ||
in | ||
{ | ||
font-family = [ | ||
fonts.monospace.name | ||
fonts.emoji.name | ||
]; | ||
font-size = fonts.sizes.terminal; | ||
background-opacity = opacity.terminal; | ||
theme = scheme.slug; | ||
}; | ||
example = lib.literalExpression '' | ||
{ | ||
theme = "catppuccin-mocha"; | ||
font-size = 10; | ||
} | ||
''; | ||
description = '' | ||
Configuration written to {file}`$XDG_CONFIG_HOME/ghostty/config`. | ||
See <https://ghostty.org/docs/config/reference> for more information. | ||
''; | ||
}; | ||
}; | ||
config = lib.mkIf cfg.enable { | ||
home.packages = [ cfg.package ]; | ||
xdg.configFile."ghostty/config" = lib.mkIf (cfg.settings != { }) { | ||
source = keyValue.generate "ghostty-config" cfg.settings; | ||
}; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,24 @@ | ||
{ | ||
pkgs, | ||
config, | ||
inputs, | ||
lib, | ||
... | ||
}: | ||
{ | ||
home.packages = | ||
let | ||
ghosttyPkgs = builtins.getAttr pkgs.hostPlatform.system inputs.ghostty.packages; | ||
in | ||
[ ghosttyPkgs.ghostty ]; | ||
xdg.configFile."ghostty/config".text = | ||
let | ||
inherit (config.stylix) fonts opacity; | ||
inherit (config.lib.stylix) scheme; | ||
in | ||
'' | ||
font-family = ${fonts.monospace.name} | ||
font-family = ${fonts.emoji.name} | ||
font-size = ${toString fonts.sizes.terminal} | ||
background-opacity = ${toString opacity.terminal} | ||
gtk-titlebar = false | ||
window-decoration = false | ||
theme = ${scheme.slug} | ||
''; | ||
programs.ghostty = { | ||
enable = lib.mkDefault true; | ||
settings = | ||
let | ||
inherit (config.stylix) fonts opacity; | ||
inherit (config.lib.stylix) scheme; | ||
in | ||
{ | ||
font-family = [ | ||
fonts.monospace.name | ||
fonts.emoji.name | ||
]; | ||
font-size = fonts.sizes.terminal; | ||
background-opacity = opacity.terminal; | ||
theme = scheme.slug; | ||
}; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters