From 07b91de2f297acb4c4fc6e1afa755e77902dfbaf Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Mon, 5 Apr 2021 00:57:32 +0000 Subject: [PATCH] home: terminal: add termite --- home/terminal/default.nix | 8 ++++++ home/terminal/termite.nix | 53 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 61 insertions(+) create mode 100644 home/terminal/termite.nix diff --git a/home/terminal/default.nix b/home/terminal/default.nix index bab73aa..4c3f5cb 100644 --- a/home/terminal/default.nix +++ b/home/terminal/default.nix @@ -8,10 +8,18 @@ let in { imports = [ + ./termite.nix ]; options.my.home = with lib; { terminal = { + program = mkOption { + type = with types; nullOr (enum [ "termite" ]); + default = null; + example = "termite"; + description = "Which terminal to use for home session"; + }; + colors = { background = mkColorOption "Background color" "#161616"; foreground = mkColorOption "Foreground color" "#ffffff"; diff --git a/home/terminal/termite.nix b/home/terminal/termite.nix new file mode 100644 index 0000000..e8f67a7 --- /dev/null +++ b/home/terminal/termite.nix @@ -0,0 +1,53 @@ +{ config, lib, pkgs, ... }: +let + cfg = config.my.home.terminal; +in +{ + config = lib.mkIf (cfg.program == "termite") { + programs.termite = { + enable = true; + + # Niceties + browser = "${pkgs.xdg-utils}/bin/xdg-open"; + clickableUrl = true; + dynamicTitle = true; + fullscreen = false; + mouseAutohide = true; + urgentOnBell = true; + + # Look and feel + allowBold = true; + audibleBell = false; + cursorBlink = "system"; + font = "Monospace 9"; + scrollbar = "off"; + + + # Colors + backgroundColor = cfg.colors.background; + cursorColor = cfg.colors.cursor; + foregroundColor = cfg.colors.foreground; + foregroundBoldColor = cfg.colors.foregroundBold; + colorsExtra = with cfg.colors; '' + # Normal colors + color0 = ${black} + color1 = ${red} + color2 = ${green} + color3 = ${yellow} + color4 = ${blue} + color5 = ${magenta} + color6 = ${cyan} + color7 = ${white} + # Bold colors + color8 = ${blackBold} + color9 = ${redBold} + color10 = ${greenBold} + color11 = ${yellowBold} + color12 = ${blueBold} + color13 = ${magentaBold} + color14 = ${cyanBold} + color15 = ${whiteBold} + ''; + }; + }; +}