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

34 lines
761 B
Nix
Raw Normal View History

2024-12-13 11:12:16 +01:00
{
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 {
2024-12-15 16:03:09 +01:00
freeformType = lib.types.attrsOf iniFormat.lib.types.atom;
2024-12-13 11:12:16 +01:00
};
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; };
};
};
}