feat: add ghostty

This commit is contained in:
Moritz Böhme 2024-10-25 07:35:36 +02:00
parent 80f92962a2
commit ffab7cedc4
No known key found for this signature in database
GPG key ID: 970C6E89EB0547A9
6 changed files with 183 additions and 18 deletions

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;
};
};
}