104 lines
3.0 KiB
Nix
104 lines
3.0 KiB
Nix
{ config, ... }:
|
|
let
|
|
metaLib = config.meta.lib;
|
|
in
|
|
{
|
|
flake.modules.homeManager.terminal =
|
|
{
|
|
config,
|
|
lib,
|
|
pkgs,
|
|
...
|
|
}:
|
|
let
|
|
terminalPackage = metaLib.resolvePackagePath {
|
|
inherit pkgs;
|
|
path = config.meta.user.terminalPackagePath;
|
|
};
|
|
hasTerminalPackage = terminalPackage != null;
|
|
hasMainProgram = hasTerminalPackage && terminalPackage ? meta.mainProgram;
|
|
terminalDesktopId = if hasMainProgram then "${terminalPackage.meta.mainProgram}.desktop" else null;
|
|
in
|
|
{
|
|
assertions = [
|
|
{
|
|
assertion = hasTerminalPackage;
|
|
message = "Unknown terminal package `${lib.showAttrPath config.meta.user.terminalPackagePath}` for user `${config.meta.user.name}`.";
|
|
}
|
|
{
|
|
assertion = hasMainProgram;
|
|
message = "Terminal package `${lib.showAttrPath config.meta.user.terminalPackagePath}` must define `meta.mainProgram`.";
|
|
}
|
|
{
|
|
assertion =
|
|
hasMainProgram && builtins.pathExists "${terminalPackage}/share/applications/${terminalDesktopId}";
|
|
message = "Terminal package `${lib.showAttrPath config.meta.user.terminalPackagePath}` must provide `${terminalDesktopId}`.";
|
|
}
|
|
{
|
|
assertion = hasMainProgram && terminalPackage.meta.mainProgram == "kitty";
|
|
message = "The terminal feature currently only supports kitty-specific Home Manager configuration.";
|
|
}
|
|
];
|
|
|
|
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: Kanagawa
|
|
## license: MIT
|
|
## author: Tommaso Laurenzi
|
|
## upstream: https://github.com/rebelot/kanagawa.nvim/
|
|
|
|
background #1F1F28
|
|
foreground #DCD7BA
|
|
selection_background #2D4F67
|
|
selection_foreground #C8C093
|
|
url_color #72A7BC
|
|
cursor #C8C093
|
|
|
|
active_tab_background #1F1F28
|
|
active_tab_foreground #C8C093
|
|
inactive_tab_background #1F1F28
|
|
inactive_tab_foreground #727169
|
|
|
|
color0 #16161D
|
|
color1 #C34043
|
|
color2 #76946A
|
|
color3 #C0A36E
|
|
color4 #7E9CD8
|
|
color5 #957FB8
|
|
color6 #6A9589
|
|
color7 #C8C093
|
|
|
|
color8 #727169
|
|
color9 #E82424
|
|
color10 #98BB6C
|
|
color11 #E6C384
|
|
color12 #7FB4CA
|
|
color13 #938AA9
|
|
color14 #7AA89F
|
|
color15 #DCD7BA
|
|
|
|
color16 #FFA066
|
|
color17 #FF5D62
|
|
'';
|
|
};
|
|
};
|
|
}
|