197 lines
5.5 KiB
Nix
197 lines
5.5 KiB
Nix
{ config, ... }:
|
|
let
|
|
repo = config.repo;
|
|
|
|
mkPrimaryTerminalOption =
|
|
lib:
|
|
lib.mkOption {
|
|
type = lib.types.submodule {
|
|
options = {
|
|
package = lib.mkOption {
|
|
type = lib.types.package;
|
|
};
|
|
|
|
command = lib.mkOption {
|
|
type = lib.types.str;
|
|
};
|
|
|
|
desktopId = lib.mkOption {
|
|
type = lib.types.str;
|
|
};
|
|
|
|
execArgs = lib.mkOption {
|
|
type = lib.types.listOf lib.types.str;
|
|
default = [ ];
|
|
};
|
|
};
|
|
};
|
|
};
|
|
|
|
mkPrimaryTerminal =
|
|
{
|
|
desktopId,
|
|
packageFor,
|
|
terminalModule,
|
|
}:
|
|
{ lib, pkgs, ... }:
|
|
let
|
|
package = packageFor pkgs;
|
|
in
|
|
{
|
|
imports = [ terminalModule ];
|
|
|
|
options.repo.terminal.primary = mkPrimaryTerminalOption lib;
|
|
|
|
config = {
|
|
repo.terminal.primary = {
|
|
inherit
|
|
desktopId
|
|
package
|
|
;
|
|
command = lib.getExe package;
|
|
execArgs = [ "-e" ];
|
|
};
|
|
|
|
xdg.terminal-exec = {
|
|
enable = true;
|
|
settings.default = [ desktopId ];
|
|
};
|
|
};
|
|
};
|
|
in
|
|
{
|
|
flake.modules.homeManager.terminal-foot =
|
|
{
|
|
lib,
|
|
pkgs,
|
|
...
|
|
}:
|
|
let
|
|
repoTheme = repo.theme.kanagawa;
|
|
palette = repoTheme.palette;
|
|
hex = lib.removePrefix "#";
|
|
in
|
|
{
|
|
programs.foot = {
|
|
enable = true;
|
|
package = pkgs.foot;
|
|
settings = {
|
|
main = {
|
|
font = "JetBrains Mono:size=11:fontfeatures=-liga:fontfeatures=-calt";
|
|
pad = "3x3";
|
|
};
|
|
|
|
bell.system = "no";
|
|
|
|
scrollback.lines = 10000;
|
|
|
|
colors-dark = {
|
|
background = hex palette.background;
|
|
foreground = hex palette.foreground;
|
|
selection-background = hex palette.selectionBackground;
|
|
selection-foreground = hex palette.selectionForeground;
|
|
urls = hex palette.url;
|
|
cursor = "${hex palette.background} ${hex palette.cursor}";
|
|
|
|
regular0 = hex palette.terminal.color0;
|
|
regular1 = hex palette.terminal.color1;
|
|
regular2 = hex palette.terminal.color2;
|
|
regular3 = hex palette.terminal.color3;
|
|
regular4 = hex palette.terminal.color4;
|
|
regular5 = hex palette.terminal.color5;
|
|
regular6 = hex palette.terminal.color6;
|
|
regular7 = hex palette.terminal.color7;
|
|
|
|
bright0 = hex palette.terminal.color8;
|
|
bright1 = hex palette.terminal.color9;
|
|
bright2 = hex palette.terminal.color10;
|
|
bright3 = hex palette.terminal.color11;
|
|
bright4 = hex palette.terminal.color12;
|
|
bright5 = hex palette.terminal.color13;
|
|
bright6 = hex palette.terminal.color14;
|
|
bright7 = hex palette.terminal.color15;
|
|
|
|
"16" = hex palette.terminal.color16;
|
|
"17" = hex palette.terminal.color17;
|
|
};
|
|
};
|
|
};
|
|
};
|
|
|
|
flake.modules.homeManager.terminal-kitty =
|
|
{ pkgs, ... }:
|
|
let
|
|
repoTheme = repo.theme.kanagawa;
|
|
palette = repoTheme.palette;
|
|
in
|
|
{
|
|
programs.kitty = {
|
|
enable = true;
|
|
package = pkgs.kitty;
|
|
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}
|
|
'';
|
|
};
|
|
};
|
|
|
|
flake.modules.homeManager.primary-terminal-foot = mkPrimaryTerminal {
|
|
desktopId = "foot.desktop";
|
|
packageFor = pkgs: pkgs.foot;
|
|
terminalModule = config.flake.modules.homeManager.terminal-foot;
|
|
};
|
|
|
|
flake.modules.homeManager.primary-terminal-kitty = mkPrimaryTerminal {
|
|
desktopId = "kitty.desktop";
|
|
packageFor = pkgs: pkgs.kitty;
|
|
terminalModule = config.flake.modules.homeManager.terminal-kitty;
|
|
};
|
|
}
|