diff --git a/pkgs/default.nix b/pkgs/default.nix index a941b350..4e6c335e 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -68,6 +68,8 @@ let kat-glauca-dns = self.callPackage ./kat-glauca-dns { }; + wezterm-terminfo = self.callPackage ./wezterm-terminfo { inherit (self) ncurses; }; + kat-website = self.callPackage ./kat-website { }; kat-weather = self.callPackage ./kat-weather { }; diff --git a/pkgs/wezterm-terminfo/default.nix b/pkgs/wezterm-terminfo/default.nix new file mode 100644 index 00000000..fa449151 --- /dev/null +++ b/pkgs/wezterm-terminfo/default.nix @@ -0,0 +1,33 @@ +{ stdenv, fetchFromGitHub, lib, ncurses }: + +stdenv.mkDerivation rec { + pname = "wezterm-terminfo"; + version = "20210502-154244-3f7122cb"; + + src = fetchFromGitHub { + owner = "wez"; + repo = pname; + rev = version; + sha256 = "9HPhb7Vyy5DwBW1xeA6sEIBmmOXlky9lPShu6ZoixPw="; + fetchSubmodules = true; + }; + + nativeBuildInputs = [ + ncurses + ]; + + buildPhase = ""; + installPhase = '' + mkdir -p $out/share/terminfo/w + ${ncurses}/bin/tic -x -o $out/share/terminfo $src/termwiz/data/wezterm.terminfo + mkdir -p $out/nix-support + echo "$out" >> $out/nix-support/propagated-user-env-packages + ''; + + meta = with lib; { + license = lib.licenses.mit; + maintainers = with maintainers; [ kittywitch ]; + platforms = with platforms; linux; + }; +} + diff --git a/profiles/common/packages.nix b/profiles/common/packages.nix index 8378ba1f..fb262d98 100644 --- a/profiles/common/packages.nix +++ b/profiles/common/packages.nix @@ -7,6 +7,7 @@ lm_sensors cachix pinentry-curses + wezterm-terminfo kitty.terminfo gnupg ]; diff --git a/users/kat/base/kitty.nix b/users/kat/base/kitty.nix index c3e16519..bcea5f5a 100644 --- a/users/kat/base/kitty.nix +++ b/users/kat/base/kitty.nix @@ -1,6 +1,6 @@ { config, pkgs, ... }: { - home.sessionVariables.TERMINFO_DIRS = - "${pkgs.kitty.terminfo.outPath}/share/terminfo"; +# home.sessionVariables.TERMINFO_DIRS = +# "${pkgs.kitty.terminfo.outPath}/share/terminfo"; } diff --git a/users/kat/base/zsh.nix b/users/kat/base/zsh.nix index 35f80aae..fc29bdc1 100644 --- a/users/kat/base/zsh.nix +++ b/users/kat/base/zsh.nix @@ -17,7 +17,7 @@ in { nix run nixpkgs.openssl -c openssl rand -hex 6 | sed 's/\(..\)\(..\)\(..\)\(..\)\(..\)\(..\)/\1:\2:\3:\4:\5:\6/' ''; nano = '' - kitty +kitten icat ${./nano.png} + ${pkgs.wezterm}/bin/wezterm imgcat ${./nano.png} ''; } // shellFunAliases { sed = "sd"; diff --git a/users/kat/gui/default.nix b/users/kat/gui/default.nix index d710df75..72800a40 100644 --- a/users/kat/gui/default.nix +++ b/users/kat/gui/default.nix @@ -3,7 +3,7 @@ { deploy.profile.gui = true; - imports = [ ./firefox ./kitty.nix ./packages.nix ./gtk.nix ]; + imports = [ ./firefox ./kitty.nix ./packages.nix ./gtk.nix ./wezterm.nix ./foot.nix ]; fonts.fontconfig.enable = true; } diff --git a/users/kat/gui/foot.nix b/users/kat/gui/foot.nix new file mode 100644 index 00000000..2b31bac9 --- /dev/null +++ b/users/kat/gui/foot.nix @@ -0,0 +1,21 @@ +{ config, lib, pkgs, ... }: + +with lib; + +let + witch.style.base16 = lib.mapAttrs' (k: v: lib.nameValuePair k "#${v.hex.rgb}") + config.lib.arc.base16.schemeForAlias.default; + colors.ansi = builtins.concatStringsSep ", " (map (c: ''"#${c.hex.rgb}"'') (sublist 0 8 config.lib.arc.base16.schemeForAlias.default.shell.colours)); + colors.brights = builtins.concatStringsSep ", " (map (c: ''"#${c.hex.rgb}"'') (sublist 8 8 config.lib.arc.base16.schemeForAlias.default.shell.colours)); +in { + programs.foot = { + enable = true; + settings = { + main = { + term = "xterm-256color"; + font = "FantasqueSansMono Nerd Font:size=10"; + dpi-aware = "yes"; + }; + }; + }; +} diff --git a/users/kat/gui/wezterm.nix b/users/kat/gui/wezterm.nix new file mode 100644 index 00000000..5da42db2 --- /dev/null +++ b/users/kat/gui/wezterm.nix @@ -0,0 +1,43 @@ +{ config, lib, pkgs, ... }: + +with lib; + +let + witch.style.base16 = lib.mapAttrs' (k: v: lib.nameValuePair k "#${v.hex.rgb}") + config.lib.arc.base16.schemeForAlias.default; + colors.ansi = builtins.concatStringsSep ", " (map (c: ''"#${c.hex.rgb}"'') (sublist 0 8 config.lib.arc.base16.schemeForAlias.default.shell.colours)); + colors.brights = builtins.concatStringsSep ", " (map (c: ''"#${c.hex.rgb}"'') (sublist 8 8 config.lib.arc.base16.schemeForAlias.default.shell.colours)); +in { + home.packages = [ + pkgs.wezterm + ]; + + xdg.configFile."wezterm/wezterm.lua".text = '' + local wezterm = require 'wezterm'; + + return { + term = "wezterm", + font = wezterm.font_with_fallback({"FantasqueSansMono Nerd Font","Twitter Color Emoji"}), + font_size = 10.0, + window_background_opacity = 0.9, + hide_tab_bar_if_only_one_tab = true, + colors = { + ansi = {${colors.ansi}}, + brights = {${colors.brights}}, + background = "${witch.style.base16.base00}", + foreground = "${witch.style.base16.base05}", + tab_bar = { + background = "${witch.style.base16.base00}", + active_tab = { + bg_color = "${witch.style.base16.base0A}", + fg_color = "${witch.style.base16.base05}", + }, + inactive_tab = { + bg_color = "${witch.style.base16.base01}", + fg_color = "${witch.style.base16.base03}", + }, + }, + }, + } + ''; +} diff --git a/users/kat/sway/sway.nix b/users/kat/sway/sway.nix index 8d5c9bc3..ab151a41 100644 --- a/users/kat/sway/sway.nix +++ b/users/kat/sway/sway.nix @@ -98,7 +98,7 @@ in style = "Normal"; size = font.size; }; - terminal = "${pkgs.kitty}/bin/kitty"; + terminal = "${pkgs.wezterm}/bin/wezterm"; # TODO: replace with wofi menu = "${pkgs.j4-dmenu-desktop}/bin/j4-dmenu-desktop --dmenu=\"${dmenu}\" --term='${cfg.terminal}'";