From 1fae8d3e9cf063694bd426eae9337f8744796d3d Mon Sep 17 00:00:00 2001 From: Daniel Lundin Date: Sat, 10 Aug 2024 23:06:08 +0200 Subject: [PATCH] Add ghostty --- flake.lock | 266 ++++++++++++++++++++++++++++++++++++++++ flake.nix | 16 ++- home/common/default.nix | 1 + home/common/ghostty.nix | 75 +++++++++++ home/dln/desktop.nix | 3 +- 5 files changed, 359 insertions(+), 2 deletions(-) create mode 100644 home/common/ghostty.nix diff --git a/flake.lock b/flake.lock index c14c9dd..bd26dc4 100644 --- a/flake.lock +++ b/flake.lock @@ -35,6 +35,22 @@ "type": "github" } }, + "flake-compat_2": { + "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-utils": { "locked": { "lastModified": 1659877975, @@ -50,6 +66,122 @@ "type": "github" } }, + "flake-utils_2": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1705309234, + "narHash": "sha256-uNRRNRKmJyCRC/8y1RqBkqWBLM034y4qN7EprSdmgyA=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "1ef2e671c3b0c19053962c07dbda38332dcebf26", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils_3": { + "inputs": { + "systems": "systems_2" + }, + "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_4": { + "inputs": { + "systems": "systems_3" + }, + "locked": { + "lastModified": 1705309234, + "narHash": "sha256-uNRRNRKmJyCRC/8y1RqBkqWBLM034y4qN7EprSdmgyA=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "1ef2e671c3b0c19053962c07dbda38332dcebf26", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "ghostty": { + "inputs": { + "nixpkgs-stable": [ + "nixpkgs" + ], + "nixpkgs-unstable": [ + "nixpkgs" + ], + "zig": "zig", + "zls": "zls" + }, + "locked": { + "lastModified": 1723350205, + "narHash": "sha256-+Nks9F8VuC9w8X2YaHU1+420Ky2DHP8n6aTg78l3dRE=", + "ref": "refs/heads/main", + "rev": "1cbeb264c908fecfe54c3fff260be28169852c09", + "revCount": 6877, + "type": "git", + "url": "ssh://git@github.com/ghostty-org/ghostty" + }, + "original": { + "type": "git", + "url": "ssh://git@github.com/ghostty-org/ghostty" + } + }, + "ghostty-hm": { + "locked": { + "lastModified": 1702368251, + "narHash": "sha256-hafrDmzGplzm+vdIo+LkOjRfA4qRcy5JmpGGksnht5c=", + "owner": "clo4", + "repo": "ghostty-hm-module", + "rev": "887e13a6e7acf5ffaab0119d96e476d84db90904", + "type": "github" + }, + "original": { + "owner": "clo4", + "repo": "ghostty-hm-module", + "type": "github" + } + }, + "gitignore": { + "inputs": { + "nixpkgs": [ + "ghostty", + "zls", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1709087332, + "narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=", + "owner": "hercules-ci", + "repo": "gitignore.nix", + "rev": "637db329424fd7e46cf4185293b9cc8c88c95394", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "gitignore.nix", + "type": "github" + } + }, "home-manager": { "inputs": { "nixpkgs": [ @@ -70,6 +202,18 @@ "type": "github" } }, + "langref": { + "flake": false, + "locked": { + "narHash": "sha256-O6p2tiKD8ZMhSX+DeA/o5hhAvcPkU2J9lFys/r11peY=", + "type": "file", + "url": "https://raw.githubusercontent.com/ziglang/zig/0fb2015fd3422fc1df364995f9782dfe7255eccd/doc/langref.html.in" + }, + "original": { + "type": "file", + "url": "https://raw.githubusercontent.com/ziglang/zig/0fb2015fd3422fc1df364995f9782dfe7255eccd/doc/langref.html.in" + } + }, "nixpkgs": { "locked": { "lastModified": 1696019113, @@ -105,6 +249,8 @@ "root": { "inputs": { "colmena": "colmena", + "ghostty": "ghostty", + "ghostty-hm": "ghostty-hm", "home-manager": "home-manager", "nixpkgs": "nixpkgs_2" } @@ -124,6 +270,126 @@ "repo": "nixpkgs", "type": "github" } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "systems_2": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "systems_3": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "zig": { + "inputs": { + "flake-compat": [ + "ghostty" + ], + "flake-utils": "flake-utils_2", + "nixpkgs": [ + "ghostty", + "nixpkgs-stable" + ] + }, + "locked": { + "lastModified": 1723291738, + "narHash": "sha256-C3DobEyzw47Rvs9tRpe8XGrqGl4hLABu1wocjxczJ/U=", + "owner": "mitchellh", + "repo": "zig-overlay", + "rev": "d132903f2088ee03cf3561368a81cd3bd850f5ff", + "type": "github" + }, + "original": { + "owner": "mitchellh", + "repo": "zig-overlay", + "type": "github" + } + }, + "zig-overlay": { + "inputs": { + "flake-compat": "flake-compat_2", + "flake-utils": "flake-utils_4", + "nixpkgs": [ + "ghostty", + "zls", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1722600600, + "narHash": "sha256-bRpvmyAvt4OFbQJlmAURyW1To8nlRjNcQJdbOyI1MLE=", + "owner": "mitchellh", + "repo": "zig-overlay", + "rev": "4c95bb8378ca31cc06eba0a9ee0c04851221c193", + "type": "github" + }, + "original": { + "owner": "mitchellh", + "repo": "zig-overlay", + "type": "github" + } + }, + "zls": { + "inputs": { + "flake-utils": "flake-utils_3", + "gitignore": "gitignore", + "langref": "langref", + "nixpkgs": [ + "ghostty", + "nixpkgs-stable" + ], + "zig-overlay": "zig-overlay" + }, + "locked": { + "lastModified": 1722987529, + "narHash": "sha256-r7tnq70psZQXfLlDj+XzidBj352vfQFrICC7hfKHw7M=", + "owner": "zigtools", + "repo": "zls", + "rev": "d8084a342f40b444addf772fdef36a589299ebe6", + "type": "github" + }, + "original": { + "owner": "zigtools", + "ref": "master", + "repo": "zls", + "type": "github" + } } }, "root": "root", diff --git a/flake.nix b/flake.nix index 75a57a5..b918541 100644 --- a/flake.nix +++ b/flake.nix @@ -6,6 +6,15 @@ home-manager.url = "github:nix-community/home-manager"; home-manager.inputs.nixpkgs.follows = "nixpkgs"; + + ghostty = { + url = "git+ssh://git@github.com/ghostty-org/ghostty"; + inputs = { + nixpkgs-stable.follows = "nixpkgs"; + nixpkgs-unstable.follows = "nixpkgs"; + }; + }; + ghostty-hm.url = "github:clo4/ghostty-hm-module"; }; outputs = @@ -13,6 +22,8 @@ self, nixpkgs, colmena, + ghostty, + ghostty-hm, home-manager, ... }@inputs: @@ -22,7 +33,10 @@ mkHome = modules: home-manager.lib.homeManagerConfiguration { - modules = [ ./home/common ] ++ modules; + modules = [ + ghostty-hm.homeModules.default + ./home/common + ] ++ modules; pkgs = nixpkgs.legacyPackages.x86_64-linux; extraSpecialArgs = { inherit inputs outputs; diff --git a/home/common/default.nix b/home/common/default.nix index d36eaaa..3cd08e0 100644 --- a/home/common/default.nix +++ b/home/common/default.nix @@ -5,6 +5,7 @@ ./broot.nix ./devel.nix ./fish.nix + ./ghostty.nix ./gnome.nix ./k8s.nix ./nix.nix diff --git a/home/common/ghostty.nix b/home/common/ghostty.nix new file mode 100644 index 0000000..3831e0b --- /dev/null +++ b/home/common/ghostty.nix @@ -0,0 +1,75 @@ +{ + config, + inputs, + lib, + pkgs, + ... +}: +{ + config = lib.mkIf config.shelman.desktop.enable { + + home.packages = with pkgs; [ inputs.ghostty.packages.${pkgs.system}.default ]; + + programs.ghostty = { + enable = true; + settings = { + font-size = 14; + font-family = "BerkeleyMono Nerd Font"; + font-feature = [ + # "ss02", -- Clean zero + "ss03" # Slashed zero + # "ss04", -- Cut zero + ]; + + mouse-hide-while-typing = true; + cursor-style = "block"; + adjust-cursor-thickness = 5; + + shell-integration = "fish"; + + window-decoration = true; + gtk-tabs-location = "bottom"; + window-padding-x = 4; + window-padding-y = 4; + window-padding-balance = true; + window-padding-color = "extend"; + + window-theme = "system"; + + unfocused-split-opacity = 1.0; + + background = "#fefeff"; + foreground = "#222222"; + cursor-color = "#aa0000"; + selection-background = "#ffe6a4"; + selection-foreground = "#483600"; + palette = [ + "0=#000000" + "1=#9e001d" + "2=#306300" + "3=#deae00" + "4=#00669e" + "5=#7d009e" + "6=#008a9e" + "7=#f7f7f7" + "8=#000000" + "9=#ff0035" + "10=#509e00" + "11=#ffc900" + "12=#00a7ff" + "13=#cb01ff" + "14=#00e0ff" + "15=#ffffff" + ]; + + keybind = [ + "alt+shift+c=copy_from_clipboard" + "alt+shift+v=paste_from_clipboard" + "ctrl+tab=goto_split:previous" + "ctrl+enter=toggle_split_zoom" + "alt+enter=toggle_fullscreen" + ]; + }; + }; + }; +} diff --git a/home/dln/desktop.nix b/home/dln/desktop.nix index 7b80912..8525e8f 100644 --- a/home/dln/desktop.nix +++ b/home/dln/desktop.nix @@ -1,4 +1,4 @@ -{ pkgs, ... }: +{ inputs, pkgs, ... }: { shelman = { desktop.enable = true; @@ -11,6 +11,7 @@ gimp-with-plugins helvum inkscape + inputs.ghostty.packages.${pkgs.system}.default moonlight-qt obsidian pavucontrol