Make nixos use ghostty module as well
This commit is contained in:
parent
7e967f4915
commit
2db8749c25
4 changed files with 122 additions and 55 deletions
|
|
@ -28,6 +28,12 @@
|
||||||
package = null; # Use system Firefox on Darwin
|
package = null; # Use system Firefox on Darwin
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# Ghostty configuration
|
||||||
|
programs.ghostty-custom = {
|
||||||
|
enable = true;
|
||||||
|
package = null; # Use Homebrew-installed Ghostty on Darwin
|
||||||
|
};
|
||||||
|
|
||||||
home.username = "yanlin";
|
home.username = "yanlin";
|
||||||
home.homeDirectory = "/Users/yanlin";
|
home.homeDirectory = "/Users/yanlin";
|
||||||
home.stateVersion = "24.05";
|
home.stateVersion = "24.05";
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,7 @@
|
||||||
../../../modules/firefox.nix
|
../../../modules/firefox.nix
|
||||||
../../../modules/plasma.nix
|
../../../modules/plasma.nix
|
||||||
../../../modules/syncthing.nix
|
../../../modules/syncthing.nix
|
||||||
|
../../../modules/ghostty.nix
|
||||||
plasma-manager.homeModules.plasma-manager
|
plasma-manager.homeModules.plasma-manager
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
@ -19,6 +20,14 @@
|
||||||
package = pkgs.firefox;
|
package = pkgs.firefox;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# Enable Ghostty terminal with NixOS package
|
||||||
|
programs.ghostty-custom = {
|
||||||
|
enable = true;
|
||||||
|
package = pkgs.ghostty; # Install via nix on NixOS
|
||||||
|
fontSize = 13;
|
||||||
|
windowMode = "fullscreen";
|
||||||
|
};
|
||||||
|
|
||||||
# Any ThinkPad-specific home configurations can be added here
|
# Any ThinkPad-specific home configurations can be added here
|
||||||
# For example, laptop-specific aliases or scripts
|
# For example, laptop-specific aliases or scripts
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,60 +1,112 @@
|
||||||
{ pkgs, ... }:
|
{ config, pkgs, lib, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
|
||||||
|
let
|
||||||
|
cfg = config.programs.ghostty-custom;
|
||||||
|
in
|
||||||
|
|
||||||
{
|
{
|
||||||
# Note: Ghostty is currently marked as broken in nixpkgs
|
options.programs.ghostty-custom = {
|
||||||
# To use it, you'll need to either:
|
enable = mkEnableOption "Ghostty terminal emulator";
|
||||||
# 1. Set NIXPKGS_ALLOW_BROKEN=1 when running hms
|
|
||||||
# 2. Add nixpkgs.config.allowBroken = true to your configuration
|
|
||||||
# 3. Install Ghostty manually from https://ghostty.org
|
|
||||||
|
|
||||||
programs.ghostty = {
|
|
||||||
enable = true;
|
|
||||||
package = null; # Use system-installed Ghostty
|
|
||||||
|
|
||||||
settings = {
|
|
||||||
# Font settings with CJK fallback
|
|
||||||
font-family = [
|
|
||||||
"JetBrainsMono Nerd Font Mono" # Primary font for Latin + symbols
|
|
||||||
"Noto Sans CJK SC" # Simplified Chinese fallback
|
|
||||||
"Noto Sans CJK TC" # Traditional Chinese fallback
|
|
||||||
"Source Han Sans" # Alternative CJK fallback
|
|
||||||
];
|
|
||||||
font-size = 14;
|
|
||||||
|
|
||||||
# Gruvbox Dark Theme (matching tmux theme)
|
|
||||||
background = "#14191f";
|
|
||||||
cursor-style-blink = false;
|
|
||||||
|
|
||||||
# Window config
|
package = mkOption {
|
||||||
window-theme = "dark";
|
type = types.nullOr types.package;
|
||||||
window-width = 160;
|
default = null;
|
||||||
window-height = 40;
|
example = "pkgs.ghostty";
|
||||||
window-padding-balance = true;
|
description = "Ghostty package to use. Set to null on Darwin to use Homebrew-installed Ghostty, or pkgs.ghostty on NixOS.";
|
||||||
|
|
||||||
# Shell integration
|
|
||||||
shell-integration = "detect";
|
|
||||||
shell-integration-features = "cursor,sudo,title";
|
|
||||||
|
|
||||||
# Mouse settings
|
|
||||||
mouse-hide-while-typing = true;
|
|
||||||
mouse-shift-capture = false;
|
|
||||||
|
|
||||||
# Performance and appearance
|
|
||||||
adjust-cell-height = "10%";
|
|
||||||
minimum-contrast = 1.0;
|
|
||||||
|
|
||||||
# Copy/paste
|
|
||||||
copy-on-select = false;
|
|
||||||
|
|
||||||
# Scrollback
|
|
||||||
scrollback-limit = 10000;
|
|
||||||
|
|
||||||
# Bell
|
|
||||||
desktop-notifications = false;
|
|
||||||
|
|
||||||
# Quit behavior
|
|
||||||
confirm-close-surface = false;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
fontSize = mkOption {
|
||||||
|
type = types.int;
|
||||||
|
default = 14;
|
||||||
|
description = "Font size for the terminal";
|
||||||
|
};
|
||||||
|
|
||||||
|
windowMode = mkOption {
|
||||||
|
type = types.enum [ "windowed" "fullscreen" ];
|
||||||
|
default = "windowed";
|
||||||
|
description = "Window mode: 'windowed' for fixed size window or 'fullscreen' for full screen";
|
||||||
|
};
|
||||||
|
|
||||||
|
windowWidth = mkOption {
|
||||||
|
type = types.int;
|
||||||
|
default = 160;
|
||||||
|
description = "Window width in columns (only used in windowed mode)";
|
||||||
|
};
|
||||||
|
|
||||||
|
windowHeight = mkOption {
|
||||||
|
type = types.int;
|
||||||
|
default = 40;
|
||||||
|
description = "Window height in rows (only used in windowed mode)";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
# Note: Ghostty is currently marked as broken in nixpkgs
|
||||||
|
# To use it, you'll need to either:
|
||||||
|
# 1. Set NIXPKGS_ALLOW_BROKEN=1 when running hms
|
||||||
|
# 2. Add nixpkgs.config.allowBroken = true to your configuration
|
||||||
|
# 3. Install Ghostty manually from https://ghostty.org
|
||||||
|
|
||||||
|
programs.ghostty = {
|
||||||
|
enable = true;
|
||||||
|
package = cfg.package;
|
||||||
|
|
||||||
|
settings = mkMerge [
|
||||||
|
{
|
||||||
|
# Font settings with CJK fallback
|
||||||
|
font-family = [
|
||||||
|
"JetBrainsMono Nerd Font Mono" # Primary font for Latin + symbols
|
||||||
|
"Noto Sans CJK SC" # Simplified Chinese fallback
|
||||||
|
"Noto Sans CJK TC" # Traditional Chinese fallback
|
||||||
|
"Source Han Sans" # Alternative CJK fallback
|
||||||
|
];
|
||||||
|
font-size = cfg.fontSize;
|
||||||
|
|
||||||
|
# Gruvbox Dark Theme (matching tmux theme)
|
||||||
|
background = "#14191f";
|
||||||
|
cursor-style-blink = false;
|
||||||
|
|
||||||
|
# Window config
|
||||||
|
window-theme = "dark";
|
||||||
|
window-padding-balance = true;
|
||||||
|
|
||||||
|
# Shell integration
|
||||||
|
shell-integration = "detect";
|
||||||
|
shell-integration-features = "cursor,sudo,title";
|
||||||
|
|
||||||
|
# Mouse settings
|
||||||
|
mouse-hide-while-typing = true;
|
||||||
|
mouse-shift-capture = false;
|
||||||
|
|
||||||
|
# Performance and appearance
|
||||||
|
adjust-cell-height = "10%";
|
||||||
|
minimum-contrast = 1.0;
|
||||||
|
|
||||||
|
# Copy/paste
|
||||||
|
copy-on-select = false;
|
||||||
|
|
||||||
|
# Scrollback
|
||||||
|
scrollback-limit = 10000;
|
||||||
|
|
||||||
|
# Bell
|
||||||
|
desktop-notifications = false;
|
||||||
|
|
||||||
|
# Quit behavior
|
||||||
|
confirm-close-surface = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
# Conditional window settings based on mode
|
||||||
|
(mkIf (cfg.windowMode == "windowed") {
|
||||||
|
window-width = cfg.windowWidth;
|
||||||
|
window-height = cfg.windowHeight;
|
||||||
|
})
|
||||||
|
|
||||||
|
(mkIf (cfg.windowMode == "fullscreen") {
|
||||||
|
fullscreen = true;
|
||||||
|
})
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -62,7 +62,7 @@
|
||||||
"applications:org.kde.dolphin.desktop"
|
"applications:org.kde.dolphin.desktop"
|
||||||
"applications:firefox.desktop"
|
"applications:firefox.desktop"
|
||||||
"applications:obsidian.desktop"
|
"applications:obsidian.desktop"
|
||||||
"applications:org.kde.konsole.desktop"
|
"applications:com.mitchellh.ghostty.desktop"
|
||||||
"applications:org.keepassxc.KeePassXC.desktop"
|
"applications:org.keepassxc.KeePassXC.desktop"
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue