feat!: Add ghostty
Ghostty is a terminal emulator. Currently we use kitty, but we've been
having some issues so this change adds the new "ghostty" as an option
and makes it default-enabled for everyone!
diff --git a/flake.lock b/flake.lock
index 3d501e5..f88106a 100644
--- a/flake.lock
+++ b/flake.lock
@@ -141,6 +141,22 @@
"flake-compat": {
"flake": false,
"locked": {
+ "lastModified": 1696426674,
+ "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=",
+ "owner": "edolstra",
+ "repo": "flake-compat",
+ "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33",
+ "type": "github"
+ },
+ "original": {
+ "owner": "edolstra",
+ "repo": "flake-compat",
+ "type": "github"
+ }
+ },
+ "flake-compat_2": {
+ "flake": false,
+ "locked": {
"lastModified": 1650374568,
"narHash": "sha256-Z+s0J8/r907g149rllvwhb4pKi8Wam5ij0st8PwAh+E=",
"owner": "edolstra",
@@ -201,11 +217,11 @@
"systems": "systems_2"
},
"locked": {
- "lastModified": 1710146030,
- "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=",
+ "lastModified": 1705309234,
+ "narHash": "sha256-uNRRNRKmJyCRC/8y1RqBkqWBLM034y4qN7EprSdmgyA=",
"owner": "numtide",
"repo": "flake-utils",
- "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a",
+ "rev": "1ef2e671c3b0c19053962c07dbda38332dcebf26",
"type": "github"
},
"original": {
@@ -216,7 +232,7 @@
},
"flake-utils-plus": {
"inputs": {
- "flake-utils": "flake-utils_4"
+ "flake-utils": "flake-utils_5"
},
"locked": {
"lastModified": 1715533576,
@@ -274,6 +290,24 @@
"systems": "systems_5"
},
"locked": {
+ "lastModified": 1710146030,
+ "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=",
+ "owner": "numtide",
+ "repo": "flake-utils",
+ "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a",
+ "type": "github"
+ },
+ "original": {
+ "owner": "numtide",
+ "repo": "flake-utils",
+ "type": "github"
+ }
+ },
+ "flake-utils_5": {
+ "inputs": {
+ "systems": "systems_6"
+ },
+ "locked": {
"lastModified": 1694529238,
"narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=",
"owner": "numtide",
@@ -302,6 +336,27 @@
"type": "github"
}
},
+ "ghostty": {
+ "inputs": {
+ "flake-compat": "flake-compat",
+ "nixpkgs-stable": "nixpkgs-stable_2",
+ "nixpkgs-unstable": "nixpkgs-unstable",
+ "zig": "zig"
+ },
+ "locked": {
+ "lastModified": 1735689283,
+ "narHash": "sha256-LOZRScnB8Q9ylmlXnt2j2v4Aj1b5JZTdSeKYaFL1RDw=",
+ "owner": "ghostty-org",
+ "repo": "ghostty",
+ "rev": "60611b8a4a1d5b3c1097cce85eb0311de0696cfa",
+ "type": "github"
+ },
+ "original": {
+ "owner": "ghostty-org",
+ "repo": "ghostty",
+ "type": "github"
+ }
+ },
"home-manager": {
"inputs": {
"nixpkgs": [
@@ -324,7 +379,7 @@
},
"jujutsu": {
"inputs": {
- "flake-utils": "flake-utils",
+ "flake-utils": "flake-utils_2",
"nixpkgs": "nixpkgs_2",
"rust-overlay": "rust-overlay"
},
@@ -359,7 +414,7 @@
},
"lix-module": {
"inputs": {
- "flake-utils": "flake-utils_2",
+ "flake-utils": "flake-utils_3",
"flakey-profile": "flakey-profile",
"lix": "lix",
"nixpkgs": [
@@ -498,6 +553,22 @@
},
"nixpkgs-stable_2": {
"locked": {
+ "lastModified": 1733423277,
+ "narHash": "sha256-TxabjxEgkNbCGFRHgM/b9yZWlBj60gUOUnRT/wbVQR8=",
+ "owner": "nixos",
+ "repo": "nixpkgs",
+ "rev": "e36963a147267afc055f7cf65225958633e536bf",
+ "type": "github"
+ },
+ "original": {
+ "owner": "nixos",
+ "ref": "release-24.11",
+ "repo": "nixpkgs",
+ "type": "github"
+ }
+ },
+ "nixpkgs-stable_3": {
+ "locked": {
"lastModified": 1734835170,
"narHash": "sha256-JG6n9tQET7ZLjvwjH9BdYE6pES/Alcduxv2FDXliuBM=",
"owner": "nixos",
@@ -512,6 +583,22 @@
"type": "github"
}
},
+ "nixpkgs-unstable": {
+ "locked": {
+ "lastModified": 1733229606,
+ "narHash": "sha256-FLYY5M0rpa5C2QAE3CKLYAM6TwbKicdRK6qNrSHlNrE=",
+ "owner": "nixos",
+ "repo": "nixpkgs",
+ "rev": "566e53c2ad750c84f6d31f9ccb9d00f823165550",
+ "type": "github"
+ },
+ "original": {
+ "owner": "nixos",
+ "ref": "nixpkgs-unstable",
+ "repo": "nixpkgs",
+ "type": "github"
+ }
+ },
"nixpkgs_2": {
"locked": {
"lastModified": 1724047581,
@@ -630,7 +717,7 @@
"inputs": {
"advisory-db": "advisory-db",
"crane": "crane",
- "flake-utils": "flake-utils_3",
+ "flake-utils": "flake-utils_4",
"nixpkgs": "nixpkgs_5",
"rust-overlay": "rust-overlay_2"
},
@@ -656,6 +743,7 @@
"emacs-overlay": "emacs-overlay",
"ewwsalmoomedits--eww-widgets": "ewwsalmoomedits--eww-widgets",
"firefox-sidebery-gnome": "firefox-sidebery-gnome",
+ "ghostty": "ghostty",
"home-manager": "home-manager",
"jujutsu": "jujutsu",
"lix-module": "lix-module",
@@ -663,7 +751,7 @@
"nix-index-database": "nix-index-database",
"nixos-hardware": "nixos-hardware",
"nixpkgs": "nixpkgs_3",
- "nixpkgs-stable": "nixpkgs-stable_2",
+ "nixpkgs-stable": "nixpkgs-stable_3",
"nur": "nur",
"radicle": "radicle",
"snowfall-lib": "snowfall-lib",
@@ -716,7 +804,7 @@
},
"snowfall-lib": {
"inputs": {
- "flake-compat": "flake-compat",
+ "flake-compat": "flake-compat_2",
"flake-utils-plus": "flake-utils-plus",
"nixpkgs": [
"nixpkgs"
@@ -830,6 +918,21 @@
"type": "github"
}
},
+ "systems_6": {
+ "locked": {
+ "lastModified": 1681028828,
+ "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
+ "owner": "nix-systems",
+ "repo": "default",
+ "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
+ "type": "github"
+ },
+ "original": {
+ "owner": "nix-systems",
+ "repo": "default",
+ "type": "github"
+ }
+ },
"templates": {
"locked": {
"lastModified": 1708553502,
@@ -916,6 +1019,31 @@
"repo": "zen-browser-flake",
"type": "github"
}
+ },
+ "zig": {
+ "inputs": {
+ "flake-compat": [
+ "ghostty"
+ ],
+ "flake-utils": "flake-utils",
+ "nixpkgs": [
+ "ghostty",
+ "nixpkgs-stable"
+ ]
+ },
+ "locked": {
+ "lastModified": 1717848532,
+ "narHash": "sha256-d+xIUvSTreHl8pAmU1fnmkfDTGQYCn2Rb/zOwByxS2M=",
+ "owner": "mitchellh",
+ "repo": "zig-overlay",
+ "rev": "02fc5cc555fc14fda40c42d7c3250efa43812b43",
+ "type": "github"
+ },
+ "original": {
+ "owner": "mitchellh",
+ "repo": "zig-overlay",
+ "type": "github"
+ }
}
},
"root": "root",
diff --git a/flake.nix b/flake.nix
index 162027d..162d4de 100644
--- a/flake.nix
+++ b/flake.nix
@@ -26,6 +26,8 @@
flake = false;
};
+ ghostty.url = "github:ghostty-org/ghostty";
+
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
diff --git a/modules/home/terminal/default.nix b/modules/home/terminal/default.nix
index 5d5ebdc..a8eb099 100644
--- a/modules/home/terminal/default.nix
+++ b/modules/home/terminal/default.nix
@@ -1,39 +1,10 @@
{
- config,
lib,
- pkgs,
...
}:
{
- options.chimera.terminal.kitty = {
- enable = lib.mkOption {
- type = lib.types.bool;
- description = "Use kitty as your terminal";
- default = true;
- };
- };
-
- config = lib.mkIf config.chimera.terminal.kitty.enable {
- home.shellAliases = {
- ssh = "${config.programs.kitty.package}/bin/kitten ssh";
- };
-
- programs.kitty = {
- enable = true;
- themeFile =
- if config.chimera.theme.catppuccin.enable then
- "Catppuccin-${config.chimera.theme.catppuccin.style}"
- else
- null;
- font = config.chimera.theme.font.mono;
- shellIntegration = {
- enableZshIntegration = config.chimera.shell.zsh.enable;
- enableBashIntegration = config.chimera.shell.bash.enable;
- };
- settings = {
- confirm_os_window_close = -1;
- symbol_map = lib.mkIf config.chimera.theme.font.nerdFontGlyphs.enable "U+23FB-U+23FE,U+2665,U+26A1,U+2B58,U+E000-U+E00A,U+E0A0-U+E0A3,U+E0B0-U+E0D4,U+E200-U+E2A9,U+E300-U+E3E3,U+E5FA-U+E6AA,U+E700-U+E7C5,U+EA60-U+EBEB,U+F000-U+F2E0,U+F300-U+F32F,U+F400-U+F4A9,U+F500-U+F8FF,U+F0001-U+F1AF0 Symbols Nerd Font Mono";
- };
- };
+ options.chimera.terminal.default = lib.mkOption {
+ type = lib.types.str;
+ description = "Your default terminal, used in window manager configuration, etc.";
};
}
diff --git a/modules/home/terminal/ghostty/default.nix b/modules/home/terminal/ghostty/default.nix
new file mode 100644
index 0000000..910f05f
--- /dev/null
+++ b/modules/home/terminal/ghostty/default.nix
@@ -0,0 +1,41 @@
+{
+ inputs,
+ config,
+ lib,
+ system,
+ pkgs,
+ ...
+}: let
+ cfg = config.chimera.terminal.ghostty;
+in {
+ options.chimera.terminal.ghostty = {
+ enable = lib.mkOption {
+ type = lib.types.bool;
+ description = "Use ghostty as your terminal";
+ default = true;
+ };
+ default = lib.mkOption {
+ type = lib.types.bool;
+ description = "Use ghostty as your default terminal";
+ default = true;
+ };
+ };
+
+ config = lib.mkIf cfg.enable {
+ chimera.terminal.default = lib.mkIf cfg.default "${inputs.ghostty.packages.${system}.ghostty}/bin/ghostty";
+
+ home.packages = [
+ inputs.ghostty.packages.${system}.ghostty
+ ];
+
+ gtk.enable = true;
+ gtk.iconTheme.package = pkgs.libsForQt5.breeze-icons;
+ gtk.iconTheme.name = "breeze";
+
+ xdg.configFile."ghostty/config" = lib.mkIf config.chimera.theme.catppuccin.enable {
+ text = ''
+ theme = catppuccin-${lib.strings.toLower config.chimera.theme.catppuccin.style}
+ '';
+ };
+ };
+}
diff --git a/modules/home/terminal/kitty/default.nix b/modules/home/terminal/kitty/default.nix
new file mode 100644
index 0000000..fdeb370
--- /dev/null
+++ b/modules/home/terminal/kitty/default.nix
@@ -0,0 +1,44 @@
+{
+ config,
+ lib,
+ ...
+}: let
+ cfg = config.chimera.terminal.kitty;
+in {
+ options.chimera.terminal.kitty = {
+ enable = lib.mkEnableOption "the kitty terminal emulator";
+ default = lib.mkOption {
+ type = lib.types.bool;
+ description = "Use kitty as your default terminal";
+ default = true;
+ };
+ };
+
+ config = lib.mkIf cfg.enable {
+ home.shellAliases = lib.mkIf (!config.chimera.terminal.ghostty.enable) {
+ # We can't have this set if anything except kitty is enabled, or ssh will break for non-kitty users
+ # TODO: can we make a function to dynamically choose?
+ ssh = "${config.programs.kitty.package}/bin/kitten ssh";
+ };
+
+ chimera.terminal.default = lib.mkIf cfg.default "${config.programs.kitty.package}/bin/kitty";
+
+ programs.kitty = {
+ enable = true;
+ themeFile =
+ if config.chimera.theme.catppuccin.enable then
+ "Catppuccin-${config.chimera.theme.catppuccin.style}"
+ else
+ null;
+ font = config.chimera.theme.font.mono;
+ shellIntegration = {
+ enableZshIntegration = config.chimera.shell.zsh.enable;
+ enableBashIntegration = config.chimera.shell.bash.enable;
+ };
+ settings = {
+ confirm_os_window_close = -1;
+ symbol_map = lib.mkIf config.chimera.theme.font.nerdFontGlyphs.enable "U+23FB-U+23FE,U+2665,U+26A1,U+2B58,U+E000-U+E00A,U+E0A0-U+E0A3,U+E0B0-U+E0D4,U+E200-U+E2A9,U+E300-U+E3E3,U+E5FA-U+E6AA,U+E700-U+E7C5,U+EA60-U+EBEB,U+F000-U+F2E0,U+F300-U+F32F,U+F400-U+F4A9,U+F500-U+F8FF,U+F0001-U+F1AF0 Symbols Nerd Font Mono";
+ };
+ };
+ };
+}
diff --git a/modules/home/users/minion/default.nix b/modules/home/users/minion/default.nix
index 1a62134..3628c9f 100644
--- a/modules/home/users/minion/default.nix
+++ b/modules/home/users/minion/default.nix
@@ -188,11 +188,6 @@
export PS1="\[\e]133;k;start_kitty\a\]\[\e]133;A\a\]\[\e]133;k;end_kitty\a\]\n\[\e]133;k;start_secondary_kitty\a\]\[\e]133;A;k=s\a\]\[\e]133;k;end_secondary_kitty\a\]\[\033[1;35m\][\[\e]0;\u@\h: \w\a\]\u@\h:\w]\$\[\033[0m\] \[\e]133;k;start_suffix_kitty\a\]\[\e[5 q\]\[\e]2;\w\a\]\[\e]133;k;end_suffix_kitty\a\]"
'';
- programs.kitty.extraConfig = ''
- map kitty_mod+enter launch --cwd=current --type=window
- map kitty_mod+t launch --cwd=current --type=tab
- '';
-
programs.helix.extraPackages = [
pkgs.clang-tools
pkgs.typescript-language-server
diff --git a/modules/home/wayland/hyprland/default.nix b/modules/home/wayland/hyprland/default.nix
index 098a33c..66c2964 100644
--- a/modules/home/wayland/hyprland/default.nix
+++ b/modules/home/wayland/hyprland/default.nix
@@ -108,7 +108,7 @@
settings =
let
mod = "SUPER";
- terminal = "${pkgs.kitty}/bin/kitty";
+ terminal = config.chimera.terminal.default;
menu = (if config.chimera.runner.anyrun.enable then "${inputs.anyrun.packages.${system}.anyrun}/bin/anyrun" else "");
screenshot = "${pkgs.grim}/bin/grim -g \"$(${pkgs.slurp}/bin/slurp -d)\" - | ${pkgs.wl-clipboard}/bin/wl-copy";
in
diff --git a/modules/home/wayland/niri/default.nix b/modules/home/wayland/niri/default.nix
index faf9e1b..c6e73fa 100644
--- a/modules/home/wayland/niri/default.nix
+++ b/modules/home/wayland/niri/default.nix
@@ -115,7 +115,7 @@
let
mod = "Super";
mod1 = "Alt";
- terminal = "${pkgs.kitty}/bin/kitty";
+ terminal = config.chimera.terminal.default;
menu = (
if config.chimera.runner.anyrun.enable then
"${inputs.anyrun.packages.${system}.anyrun}/bin/anyrun"