Configure terminal emulator colors centrally
This commit is contained in:
parent
95e28a3cba
commit
411cd1d2e3
24
flake.lock
24
flake.lock
|
@ -201,11 +201,11 @@
|
|||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1698795315,
|
||||
"narHash": "sha256-fF5ScAWLMHXOuqsbLSG137kS1D+gr9JPtm4H2c4yBbU=",
|
||||
"lastModified": 1699025595,
|
||||
"narHash": "sha256-e+o4PoSu2Z6Ww8y/AVUmMU200rNZoRK+p2opQ7Db8Rg=",
|
||||
"owner": "nix-community",
|
||||
"repo": "home-manager",
|
||||
"rev": "9bc7d84b8213255ecd5eb6299afdb77c36ece71d",
|
||||
"rev": "8765d4e38aa0be53cdeee26f7386173e6c65618d",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -265,11 +265,11 @@
|
|||
},
|
||||
"nixos-hardware": {
|
||||
"locked": {
|
||||
"lastModified": 1698053470,
|
||||
"narHash": "sha256-sP8D/41UiwC2qn0X40oi+DfuVzNHMROqIWdSdCI/AYA=",
|
||||
"lastModified": 1699044561,
|
||||
"narHash": "sha256-3uHmbq74CicpBPP40a6NHp830S7Rvh33uFgfIIC+7nw=",
|
||||
"owner": "nixos",
|
||||
"repo": "nixos-hardware",
|
||||
"rev": "80d98a7d55c6e27954a166cb583a41325e9512d7",
|
||||
"rev": "87f8403371fa74d9ad21ed677403cc235f37b96c",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -280,11 +280,11 @@
|
|||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1698611440,
|
||||
"narHash": "sha256-jPjHjrerhYDy3q9+s5EAsuhyhuknNfowY6yt6pjn9pc=",
|
||||
"lastModified": 1698924604,
|
||||
"narHash": "sha256-GCFbkl2tj8fEZBZCw3Tc0AkGo0v+YrQlohhEGJ/X4s0=",
|
||||
"owner": "nixos",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "0cbe9f69c234a7700596e943bfae7ef27a31b735",
|
||||
"rev": "fa804edfb7869c9fb230e174182a8a1a7e512c40",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -338,11 +338,11 @@
|
|||
"pre-commit-hooks": "pre-commit-hooks"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1698761408,
|
||||
"narHash": "sha256-9uw2BSrhFaWZwOstP6hY8jgrs/w45kz7TSP5+KdZZKg=",
|
||||
"lastModified": 1699022904,
|
||||
"narHash": "sha256-Qc0zMAsRU7gyqHmkc9QUP/FHCNKNkoYGoojnMAUcUQg=",
|
||||
"owner": "nix-community",
|
||||
"repo": "nixvim",
|
||||
"rev": "77a3f3c29817e8ec14448022c934ae708968fd22",
|
||||
"rev": "76291156fa182a7d3fdfa9233a7bcbe116c50b68",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
./gtk.nix
|
||||
./git.nix
|
||||
./mpv.nix
|
||||
./kitty.nix
|
||||
./terminals.nix
|
||||
./ssh
|
||||
./gpg.nix
|
||||
./dirs.nix
|
||||
|
@ -27,7 +27,6 @@
|
|||
|
||||
xdg.enable = true;
|
||||
xdg.configFile = {
|
||||
"alacritty/alacritty.yml".source = ./files/alacritty.yml;
|
||||
"swaylock/config".text = ''
|
||||
ignore-empty-password
|
||||
indicator-caps-lock
|
||||
|
|
|
@ -1,42 +0,0 @@
|
|||
scrolling:
|
||||
history: 16384
|
||||
|
||||
font:
|
||||
normal:
|
||||
family: Fira Code
|
||||
size: 8
|
||||
|
||||
shell:
|
||||
program: /run/current-system/sw/bin/fish
|
||||
|
||||
# Colors (Hyper)
|
||||
colors:
|
||||
# Default colors
|
||||
primary:
|
||||
background: '0x000000'
|
||||
foreground: '0xffffff'
|
||||
cursor:
|
||||
text: '0xF81CE5'
|
||||
cursor: '0xffffff'
|
||||
|
||||
# Normal colors
|
||||
normal:
|
||||
black: '0x000000'
|
||||
red: '0xfe0100'
|
||||
green: '0x33ff00'
|
||||
yellow: '0xfeff00'
|
||||
blue: '0x0066ff'
|
||||
magenta: '0xcc00ff'
|
||||
cyan: '0x00ffff'
|
||||
white: '0xd0d0d0'
|
||||
|
||||
# Bright colors
|
||||
bright:
|
||||
black: '0x808080'
|
||||
red: '0xfe0100'
|
||||
green: '0x33ff00'
|
||||
yellow: '0xfeff00'
|
||||
blue: '0x0066ff'
|
||||
magenta: '0xcc00ff'
|
||||
cyan: '0x00ffff'
|
||||
white: '0xFFFFFF'
|
|
@ -1,21 +0,0 @@
|
|||
{ ... }:
|
||||
|
||||
{
|
||||
programs.kitty = {
|
||||
enable = true;
|
||||
font = {
|
||||
name = "Fira Code";
|
||||
size = 9;
|
||||
};
|
||||
settings = {
|
||||
update_check_interval = 0;
|
||||
close_on_child_death = true;
|
||||
confirm_os_window_close = 2;
|
||||
enable_audio_bell = 0;
|
||||
term = "kitty";
|
||||
clipboard_control = false;
|
||||
scrollback_lines = 32768;
|
||||
touch_scroll_multiplier = 4;
|
||||
};
|
||||
};
|
||||
}
|
93
home/terminals.nix
Normal file
93
home/terminals.nix
Normal file
|
@ -0,0 +1,93 @@
|
|||
{ lib, ... }:
|
||||
with lib;
|
||||
let
|
||||
colors = {
|
||||
primary = {
|
||||
background = "000000";
|
||||
foreground = "ffffff";
|
||||
};
|
||||
cursor = {
|
||||
# Text under cursor
|
||||
text = "f81ce5";
|
||||
# Foreground of cursor
|
||||
cursor = "ffffff";
|
||||
};
|
||||
# Numbered colors in standard order (see colorNames)
|
||||
normal = [
|
||||
"000000"
|
||||
"fe0100"
|
||||
"33ff00"
|
||||
"feff00"
|
||||
"0066ff"
|
||||
"cc00ff"
|
||||
"00ffff"
|
||||
"d0d0d0"
|
||||
];
|
||||
bright = [
|
||||
"808080"
|
||||
"fe0100"
|
||||
"33ff00"
|
||||
"feff00"
|
||||
"0066ff"
|
||||
"cc00ff"
|
||||
"00ffff"
|
||||
"ffffff"
|
||||
];
|
||||
};
|
||||
colorNames =
|
||||
[ "black" "red" "green" "yellow" "blue" "magenta" "cyan" "white" ];
|
||||
namedColors = prefix: colors:
|
||||
listToAttrs
|
||||
(zipListsWith nameValuePair colorNames (map (c: prefix + c) colors));
|
||||
numberedColors = attrPrefix: valuePrefix: attrOffset: colors:
|
||||
listToAttrs (zipListsWith nameValuePair
|
||||
(map (i: attrPrefix + toString (i + attrOffset)) (range 0 7))
|
||||
(map (c: valuePrefix + c) colors));
|
||||
|
||||
font = {
|
||||
name = "Fira Code";
|
||||
size = 9;
|
||||
};
|
||||
in {
|
||||
# Not used on most systems
|
||||
programs.foot = {
|
||||
settings = {
|
||||
main.font = "${font.name}:size=${toString font.size}";
|
||||
colors = colors.primary // (numberedColors "regular" "" 0 colors.normal)
|
||||
// (numberedColors "bright" "" 0 colors.bright);
|
||||
};
|
||||
};
|
||||
|
||||
programs.alacritty = {
|
||||
enable = true;
|
||||
settings = {
|
||||
scrolling.history = 16384;
|
||||
font = {
|
||||
normal.family = font.name;
|
||||
inherit (font) size;
|
||||
};
|
||||
colors = with colors; {
|
||||
primary = mapAttrs (_: value: "0x" + value) primary;
|
||||
cursor = mapAttrs (_: value: "0x" + value) cursor;
|
||||
normal = namedColors "0x" normal;
|
||||
bright = namedColors "0x" bright;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
programs.kitty = {
|
||||
enable = true;
|
||||
inherit font;
|
||||
settings = {
|
||||
update_check_interval = 0;
|
||||
close_on_child_death = true;
|
||||
confirm_os_window_close = 2;
|
||||
enable_audio_bell = 0;
|
||||
term = "kitty";
|
||||
clipboard_control = false;
|
||||
scrollback_lines = 32768;
|
||||
touch_scroll_multiplier = 4;
|
||||
} // (numberedColors "color" "#" 0 colors.normal)
|
||||
// (numberedColors "color" "#" 8 colors.bright);
|
||||
};
|
||||
}
|
|
@ -97,7 +97,6 @@
|
|||
yubikey-manager
|
||||
|
||||
# GUI tools
|
||||
alacritty
|
||||
evince
|
||||
gnome3.eog
|
||||
gnome3.gnome-system-monitor
|
||||
|
|
|
@ -13,14 +13,7 @@
|
|||
networking.hostName = "mistmane";
|
||||
|
||||
home-manager.users.artemis = {
|
||||
programs.foot = {
|
||||
enable = true;
|
||||
settings.main = {
|
||||
shell = "/run/current-system/sw/bin/fish";
|
||||
font = "Fira Code:size=6";
|
||||
dpi-aware = "yes";
|
||||
};
|
||||
};
|
||||
programs.foot.enable = true;
|
||||
wayland.windowManager.sway.config = {
|
||||
terminal = lib.mkForce "foot";
|
||||
input."9610:30:HAILUCK_CO.,LTD_USB_KEYBOARD_Touchpad" = {
|
||||
|
|
Loading…
Reference in a new issue