terminals.nix 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. let
  2. disabled = import ./disabledapp.nix;
  3. columns = 80;
  4. lines = 24;
  5. pad = 4;
  6. term = "xterm-256color";
  7. fontsize = 12;
  8. scrollback = 10000;
  9. colors = {
  10. background = "000000";
  11. foreground = "ffffff";
  12. normal = {
  13. black = "000000";
  14. red = "ff5454";
  15. green = "4ab464";
  16. yellow = "dec26a";
  17. blue = "5264f6";
  18. magenta = "cc82e4";
  19. cyan = "84deed";
  20. white = "cbcbcb";
  21. };
  22. bright = {
  23. black = "545454";
  24. red = "ff7c7c";
  25. green = "8cc89c";
  26. yellow = "f2f292";
  27. blue = "86b6ff";
  28. magenta = "ea96ff";
  29. cyan = "92ffff";
  30. white = "ffffff";
  31. };
  32. };
  33. in {
  34. programs = {
  35. alacritty = {
  36. enable = true;
  37. settings = {
  38. env.TERM = term;
  39. font = {
  40. size = fontsize;
  41. offset.x = 1;
  42. };
  43. window = {
  44. dimensions = {
  45. inherit columns;
  46. inherit lines;
  47. };
  48. padding = {
  49. x = pad;
  50. y = pad;
  51. };
  52. decorations_theme_variant = "Dark";
  53. };
  54. scrolling.history = scrollback;
  55. colors = {
  56. primary = {
  57. background = "#${colors.background}";
  58. foreground = "#${colors.foreground}";
  59. };
  60. search = {
  61. focused_match = {
  62. background = "#${colors.foreground}";
  63. foreground = "#${colors.background}";
  64. };
  65. matches = {
  66. background = "#${colors.normal.yellow}";
  67. foreground = "#${colors.background}";
  68. };
  69. };
  70. normal = {
  71. black = "#${colors.normal.black}";
  72. red = "#${colors.normal.red}";
  73. green = "#${colors.normal.green}";
  74. yellow = "#${colors.normal.yellow}";
  75. blue = "#${colors.normal.blue}";
  76. magenta = "#${colors.normal.magenta}";
  77. cyan = "#${colors.normal.cyan}";
  78. white = "#${colors.normal.white}";
  79. };
  80. bright = {
  81. black = "#${colors.bright.black}";
  82. red = "#${colors.bright.red}";
  83. green = "#${colors.bright.green}";
  84. yellow = "#${colors.bright.yellow}";
  85. blue = "#${colors.bright.blue}";
  86. magenta = "#${colors.bright.magenta}";
  87. cyan = "#${colors.bright.cyan}";
  88. white = "#${colors.bright.white}";
  89. };
  90. };
  91. };
  92. };
  93. foot = {
  94. enable = true;
  95. settings = {
  96. main = {
  97. inherit term;
  98. font = "monospace:size=" + toString fontsize;
  99. dpi-aware = "no";
  100. pad = toString pad + "x" + toString pad;
  101. initial-window-size-chars = toString columns + "x" + toString lines;
  102. };
  103. bell.urgent = "yes";
  104. scrollback.lines = scrollback;
  105. csd = {
  106. border-color = "ff3e3e3e";
  107. border-width = 2;
  108. button-color = "ffffffff";
  109. color = "ff303030";
  110. hide-when-maximized = "yes";
  111. };
  112. key-bindings = {
  113. scrollback-up-page = "Shift+Page_Up Shift+KP_Page_Up";
  114. scrollback-down-page = "Shift+Page_Down Shift+KP_Page_Down";
  115. scrollback-home = "Shift+Home Shift+KP_Home";
  116. scrollback-end = "Shift+End Shift+KP_End";
  117. };
  118. colors = {
  119. inherit (colors) background;
  120. inherit (colors) foreground;
  121. regular0 = colors.normal.black;
  122. regular1 = colors.normal.red;
  123. regular2 = colors.normal.green;
  124. regular3 = colors.normal.yellow;
  125. regular4 = colors.normal.blue;
  126. regular5 = colors.normal.magenta;
  127. regular6 = colors.normal.cyan;
  128. regular7 = colors.normal.white;
  129. bright0 = colors.bright.black;
  130. bright1 = colors.bright.red;
  131. bright2 = colors.bright.green;
  132. bright3 = colors.bright.yellow;
  133. bright4 = colors.bright.blue;
  134. bright5 = colors.bright.magenta;
  135. bright6 = colors.bright.cyan;
  136. bright7 = colors.bright.white;
  137. };
  138. };
  139. };
  140. };
  141. xdg.desktopEntries = {
  142. foot = {
  143. categories = [ "System" "TerminalEmulator" ];
  144. comment = "A wayland native terminal emulator";
  145. exec = "foot -d warning";
  146. genericName = "Terminal";
  147. icon = "foot";
  148. name = "Foot";
  149. terminal = false;
  150. type = "Application";
  151. };
  152. "org.codeberg.dnkl.foot" = disabled;
  153. "org.codeberg.dnkl.foot-server" = disabled;
  154. "org.codeberg.dnkl.footclient" = disabled;
  155. };
  156. }