102 lines
3.2 KiB
Nix
102 lines
3.2 KiB
Nix
{ config, ... }:
|
|
let
|
|
repo = config.repo;
|
|
repoHelpers = repo.helpers;
|
|
in
|
|
{
|
|
flake.modules.homeManager.terminal =
|
|
{
|
|
lib,
|
|
pkgs,
|
|
...
|
|
}:
|
|
let
|
|
repoTheme = repo.theme.kanagawa;
|
|
palette = repoTheme.palette;
|
|
terminalPackage = repoHelpers.resolvePackagePath {
|
|
inherit pkgs;
|
|
path = repo.desktop.terminal.packagePath;
|
|
};
|
|
terminalDesktopId = repo.desktop.terminal.desktopId;
|
|
in
|
|
{
|
|
assertions = [
|
|
{
|
|
assertion = terminalPackage != null;
|
|
message = "Unknown terminal package `${lib.showAttrPath repo.desktop.terminal.packagePath}`.";
|
|
}
|
|
{
|
|
assertion = repo.desktop.terminal.command == "kitty";
|
|
message = "The terminal feature currently only supports kitty.";
|
|
}
|
|
{
|
|
assertion =
|
|
terminalPackage == null
|
|
|| terminalDesktopId == null
|
|
|| builtins.pathExists "${terminalPackage}/share/applications/${terminalDesktopId}";
|
|
message = "Terminal package `${lib.showAttrPath repo.desktop.terminal.packagePath}` must provide `${terminalDesktopId}`.";
|
|
}
|
|
];
|
|
|
|
xdg.terminal-exec = {
|
|
enable = true;
|
|
settings.default = lib.optional (terminalDesktopId != null) terminalDesktopId;
|
|
};
|
|
|
|
programs.kitty = {
|
|
enable = true;
|
|
font = {
|
|
name = "JetBrains Mono";
|
|
size = 11;
|
|
};
|
|
settings = {
|
|
disable_ligatures = "always";
|
|
scrollback_lines = 10000;
|
|
enable_audio_bell = false;
|
|
confirm_os_window_close = 0;
|
|
window_padding_width = 3;
|
|
update_check_interval = 0;
|
|
};
|
|
extraConfig = ''
|
|
## name: ${repoTheme.displayName}
|
|
## license: MIT
|
|
## author: Tommaso Laurenzi
|
|
## upstream: https://github.com/rebelot/kanagawa.nvim/
|
|
|
|
background ${palette.background}
|
|
foreground ${palette.foreground}
|
|
selection_background ${palette.selectionBackground}
|
|
selection_foreground ${palette.selectionForeground}
|
|
url_color ${palette.url}
|
|
cursor ${palette.cursor}
|
|
|
|
active_tab_background ${palette.background}
|
|
active_tab_foreground ${palette.selectionForeground}
|
|
inactive_tab_background ${palette.background}
|
|
inactive_tab_foreground ${palette.muted}
|
|
|
|
color0 ${palette.terminal.color0}
|
|
color1 ${palette.terminal.color1}
|
|
color2 ${palette.terminal.color2}
|
|
color3 ${palette.terminal.color3}
|
|
color4 ${palette.terminal.color4}
|
|
color5 ${palette.terminal.color5}
|
|
color6 ${palette.terminal.color6}
|
|
color7 ${palette.terminal.color7}
|
|
|
|
color8 ${palette.terminal.color8}
|
|
color9 ${palette.terminal.color9}
|
|
color10 ${palette.terminal.color10}
|
|
color11 ${palette.terminal.color11}
|
|
color12 ${palette.terminal.color12}
|
|
color13 ${palette.terminal.color13}
|
|
color14 ${palette.terminal.color14}
|
|
color15 ${palette.terminal.color15}
|
|
|
|
color16 ${palette.terminal.color16}
|
|
color17 ${palette.terminal.color17}
|
|
'';
|
|
};
|
|
};
|
|
}
|