feat: add ghostty

This commit is contained in:
Moritz Böhme 2024-10-25 07:35:36 +02:00
parent 80f92962a2
commit ffab7cedc4
Signed by: moritz
GPG key ID: 970C6E89EB0547A9
6 changed files with 183 additions and 18 deletions

View file

@ -342,7 +342,25 @@
},
"flake-utils_2": {
"inputs": {
"systems": "systems_4"
"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"
}
},
"flake-utils_3": {
"inputs": {
"systems": "systems_5"
},
"locked": {
"lastModified": 1726560853,
@ -358,6 +376,26 @@
"type": "github"
}
},
"ghostty": {
"inputs": {
"nixpkgs-stable": "nixpkgs-stable",
"nixpkgs-unstable": "nixpkgs-unstable",
"zig": "zig"
},
"locked": {
"lastModified": 1729372614,
"narHash": "sha256-WqbbdfXbayKTGplZ6GntKq1blX3YTI7WzXEPWhqo0fA=",
"ref": "refs/heads/main",
"rev": "1134a9cbea571a3303df352636b1329753b4d443",
"revCount": 7757,
"type": "git",
"url": "ssh://git@github.com/ghostty-org/ghostty"
},
"original": {
"type": "git",
"url": "ssh://git@github.com/ghostty-org/ghostty"
}
},
"git-hooks": {
"inputs": {
"flake-compat": "flake-compat_3",
@ -653,7 +691,7 @@
"hyprwayland-scanner": "hyprwayland-scanner",
"nixpkgs": "nixpkgs_4",
"pre-commit-hooks": "pre-commit-hooks",
"systems": "systems_3",
"systems": "systems_4",
"xdph": "xdph"
},
"locked": {
@ -810,11 +848,11 @@
},
"master": {
"locked": {
"lastModified": 1729497599,
"narHash": "sha256-VIL7URnjTkpYc7FQ0QJhV7Q2n2/hi3AgiFr5Ul1/glo=",
"lastModified": 1729502391,
"narHash": "sha256-maI+uLuGbgwkvNp+FzzhLiGvd80+MS0gASpHjU6B0hY=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "f6bdbd1605b17cfbd8af51ba68db779e130d54b3",
"rev": "d3503200cd28f0ecba42a9a4f82988f469932320",
"type": "github"
},
"original": {
@ -1031,16 +1069,16 @@
},
"nixpkgs-stable": {
"locked": {
"lastModified": 1720386169,
"narHash": "sha256-NGKVY4PjzwAa4upkGtAMz1npHGoRzWotlSnVlqI40mo=",
"owner": "NixOS",
"lastModified": 1726062281,
"narHash": "sha256-PyFVySdGj3enKqm8RQuo4v1KLJLmNLOq2yYOHsI6e2Q=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "194846768975b7ad2c4988bdb82572c00222c0d7",
"rev": "e65aa8301ba4f0ab8cb98f944c14aa9da07394f8",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-24.05",
"owner": "nixos",
"ref": "release-24.05",
"repo": "nixpkgs",
"type": "github"
}
@ -1061,6 +1099,38 @@
"type": "github"
}
},
"nixpkgs-stable_3": {
"locked": {
"lastModified": 1720386169,
"narHash": "sha256-NGKVY4PjzwAa4upkGtAMz1npHGoRzWotlSnVlqI40mo=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "194846768975b7ad2c4988bdb82572c00222c0d7",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-24.05",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs-unstable": {
"locked": {
"lastModified": 1719082008,
"narHash": "sha256-jHJSUH619zBQ6WdC21fFAlDxHErKVDJ5fpN0Hgx4sjs=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "9693852a2070b398ee123a329e68f0dab5526681",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_10": {
"locked": {
"lastModified": 1692934111,
@ -1254,7 +1324,7 @@
},
"nuschtosSearch": {
"inputs": {
"flake-utils": "flake-utils_2",
"flake-utils": "flake-utils_3",
"nixpkgs": [
"nixvim",
"nixpkgs"
@ -1282,7 +1352,7 @@
"hyprland",
"nixpkgs"
],
"nixpkgs-stable": "nixpkgs-stable"
"nixpkgs-stable": "nixpkgs-stable_2"
},
"locked": {
"lastModified": 1728778939,
@ -1303,7 +1373,7 @@
"flake-compat": "flake-compat_6",
"gitignore": "gitignore_4",
"nixpkgs": "nixpkgs_9",
"nixpkgs-stable": "nixpkgs-stable_2"
"nixpkgs-stable": "nixpkgs-stable_3"
},
"locked": {
"lastModified": 1729104314,
@ -1346,6 +1416,7 @@
"disko": "disko",
"flake-parts": "flake-parts",
"flake-utils": "flake-utils",
"ghostty": "ghostty",
"home-manager": "home-manager_2",
"hypr-contrib": "hypr-contrib",
"hyprland": "hyprland",
@ -1411,6 +1482,21 @@
}
},
"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"
}
},
"systems_4": {
"locked": {
"lastModified": 1689347949,
"narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=",
@ -1425,7 +1511,7 @@
"type": "github"
}
},
"systems_4": {
"systems_5": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
@ -1440,7 +1526,7 @@
"type": "github"
}
},
"systems_5": {
"systems_6": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
@ -1498,7 +1584,7 @@
},
"utils": {
"inputs": {
"systems": "systems_5"
"systems": "systems_6"
},
"locked": {
"lastModified": 1692799911,
@ -1554,6 +1640,31 @@
"repo": "xdg-desktop-portal-hyprland",
"type": "github"
}
},
"zig": {
"inputs": {
"flake-compat": [
"ghostty"
],
"flake-utils": "flake-utils_2",
"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",

View file

@ -53,6 +53,9 @@
# Firefox user.js
arkenfox-userjs.url = "github:arkenfox/user.js";
arkenfox-userjs.flake = false;
ghostty.url = "git+ssh://git@github.com/ghostty-org/ghostty";
# ghostty.url = "/home/moritz/Documents/ghostty";
};
outputs = inputs@{ self, flake-parts, ... }:
@ -178,11 +181,13 @@
"https://hyprland.cachix.org"
"https://nix-community.cachix.org"
"https://pre-commit-hooks.cachix.org"
"https://ghostty.cachix.org"
];
extra-trusted-public-keys = [
"hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc="
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
"pre-commit-hooks.cachix.org-1:Pkk3Panw5AW24TOv6kz3PvLhlH8puAsJTBbOPmBo7Rc="
"ghostty.cachix.org-1:QB389yTa6gTyneehvqG58y0WnHjQOqgnA+wBnpWWxns="
];
};
}

View file

@ -20,6 +20,7 @@
webis.enable = true;
impermanence.enable = true;
};
terminal.package = pkgs.kitty;
programs.river.enable = true;
programs.hyprland.enable = false;
programs.exercism.enable = true;

View file

@ -0,0 +1,13 @@
{ lib
, ...
}:
with lib;
{
options.my.terminal = {
package = mkOption {
type = types.package;
apply = lib.getExe;
};
};
}

View file

@ -0,0 +1,35 @@
{ config
, lib
, pkgs
, inputs
, ...
}:
with lib;
let
cfg = config.my.programs.ghostty;
format = pkgs.formats.keyValue {
listsAsDuplicateKeys = true;
};
in
{
options.my.programs.ghostty.enable = mkEnableOption "Ghostty";
options.my.programs.ghostty.package = (mkPackageOption pkgs "Ghostty" { }) // {
inherit (inputs.ghostty.packages.${pkgs.system}) default;
};
options.my.programs.ghostty.settings = mkOption {
inherit (format) type;
description = ''
Configuration written to {file}`$XDG_CONFIG_HOME/ghostty/config`.
'';
default = { };
};
config = mkIf cfg.enable {
my.terminal.package = cfg.package;
home-manager.users.moritz = {
home.packages = [ cfg.package ];
xdg.configFile."ghostty/config".source = format.generate "ghostty-config" cfg.settings;
};
};
}

View file

@ -68,7 +68,7 @@ in
map = {
normal = {
"Super Q" = "close";
"Super Return" = "spawn kitty";
"Super Return" = "spawn '${config.my.terminal.package}'";
"Super R" = ''spawn 'exec $(tofi-run --fuzzy-match=true)' '';
"Super W" = ''spawn "pkill -USR1 waybar"'';
"Super+Shift R" = "spawn ~/.config/river/init";