nixos-config/home-manager/modules/ghostty/default.nix

33 lines
761 B
Nix

{
pkgs,
config,
lib,
...
}:
let
cfg = config.eboskma.programs.ghostty;
iniFormat = pkgs.formats.iniWithGlobalSection { listsAsDuplicateKeys = true; };
in
{
options.eboskma.programs.ghostty = {
enable = lib.mkEnableOption "ghostty";
package = lib.mkPackageOption pkgs "ghostty" { };
settings = lib.mkOption {
description = "Ghostty config.";
type = lib.types.submodule {
freeformType = lib.types.attrsOf iniFormat.lib.types.atom;
};
default = { };
};
};
config = lib.mkIf cfg.enable {
home.packages = [ cfg.package ];
xdg.configFile.ghostty-config = {
target = "ghostty/config";
source = iniFormat.generate "ghostty-config" { globalSection = cfg.settings; };
};
};
}