nix-home/home/modules/programs/my-kitty/default.nix

69 lines
1.5 KiB
Nix
Raw Normal View History

{ pkgs, config, lib, ... }:
let
cfg = config.nki.programs.kitty;
cmd = if pkgs.stdenv.isDarwin then "cmd" else "ctrl";
in
with lib;
{
imports = [ ./darwin.nix ./linux.nix ];
options.nki.programs.kitty = {
enable = mkEnableOption "Enable kitty";
# font
fontSize = mkOption {
type = types.int;
description = "Font size";
default = 21;
};
background = mkOption
{
type = types.nullOr types.path;
description = "Path to the background image. If not set, default to a 0.9 opacity";
default = null;
};
};
config.programs.kitty = mkIf cfg.enable {
enable = true;
font.package = pkgs.fantasque-sans-mono;
font.name = "Fantasque Sans Mono";
font.size = cfg.fontSize;
theme = "Ayu Light";
settings =
let
# Background color and transparency
background =
if isNull cfg.background then {
background_opacity = "0.9";
dynamic_background_opacity = true;
} else {
2022-06-11 19:51:49 +00:00
background_image = "${cfg.background}";
background_image_layout = "scaled";
background_tint = "0.85";
};
in
2022-07-06 16:42:03 +00:00
mkMerge [
background
{
# Scrollback (128MBs)
scrollback_pager_history_size = 128;
2022-07-06 16:42:03 +00:00
# Disable Shell integration (leave it for Nix)
shell_integration = "no-rc";
# Allow remote control (for kakoune integration)
allow_remote_control = true;
}
];
keybindings = { };
};
}