feat: lsd -> eza, LS_COLORS sync

This commit is contained in:
winston 2024-03-14 22:12:11 +01:00
parent 75efe54dc0
commit 521417d29d
Signed by: winston
GPG key ID: 3786770EDBC2B481
5 changed files with 102 additions and 47 deletions

View file

@ -1,7 +1,7 @@
{
"catppuccin-bat": {
"cargoLocks": null,
"date": "2024-03-10",
"date": "2024-03-12",
"extract": null,
"name": "catppuccin-bat",
"passthru": null,
@ -11,12 +11,12 @@
"fetchSubmodules": false,
"leaveDotGit": false,
"name": null,
"rev": "e9d92785fdf1afe0cd72d8d5ccb6902120d23f77",
"sha256": "sha256-bWVgDPaFcJK5sCStt1BvB8MTMy7o2uzLYDAKgWqRs3M=",
"rev": "7f5f4f8be7ca2a71712c82e3ce8723674a22bab1",
"sha256": "sha256-DkNZqPhs+U/LCMiYp4gFAorElWik5OGWe12dYinqKWc=",
"type": "git",
"url": "https://github.com/catppuccin/bat"
},
"version": "e9d92785fdf1afe0cd72d8d5ccb6902120d23f77"
"version": "7f5f4f8be7ca2a71712c82e3ce8723674a22bab1"
},
"catppuccin-wezterm": {
"cargoLocks": null,

View file

@ -3,16 +3,16 @@
{
catppuccin-bat = {
pname = "catppuccin-bat";
version = "e9d92785fdf1afe0cd72d8d5ccb6902120d23f77";
version = "7f5f4f8be7ca2a71712c82e3ce8723674a22bab1";
src = fetchgit {
url = "https://github.com/catppuccin/bat";
rev = "e9d92785fdf1afe0cd72d8d5ccb6902120d23f77";
rev = "7f5f4f8be7ca2a71712c82e3ce8723674a22bab1";
fetchSubmodules = false;
deepClone = false;
leaveDotGit = false;
sha256 = "sha256-bWVgDPaFcJK5sCStt1BvB8MTMy7o2uzLYDAKgWqRs3M=";
sha256 = "sha256-DkNZqPhs+U/LCMiYp4gFAorElWik5OGWe12dYinqKWc=";
};
date = "2024-03-10";
date = "2024-03-12";
};
catppuccin-wezterm = {
pname = "catppuccin-wezterm";

View file

@ -5,6 +5,64 @@
...
}: let
inherit (pkgs.stdenv) isDarwin isLinux;
overrides = {
mocha = {
rosewater = "#ece3e1";
flamingo = "#e1d2d2";
pink = "#ddccd8";
mauve = "#bbb2c9";
red = "#c4a2aa";
maroon = "#cbadb1";
peach = "#d5beb4";
yellow = "#ece3d3";
green = "#b9ddb6";
teal = "#badad4";
sky = "#b8d4db";
sapphire = "#a9c0ce";
blue = "#aab3c7";
lavender = "#bfc1d2";
text = "#d3d6e1";
subtext1 = "#bec2d2";
subtext0 = "#a8adc3";
overlay2 = "#9299b4";
overlay1 = "#7c84a5";
overlay0 = "#686f94";
surface2 = "#555a7b";
surface1 = "#434664";
surface0 = "#30314b";
base = "#101010";
mantle = "#090909";
crust = "#080808";
};
};
removeHashes = attrs: builtins.mapAttrs (k: v: lib.removePrefix "#" v) attrs;
fromYAMLfile = f: let
jsonFile = pkgs.runCommand "in-${f}.json" {nativeBuildInputs = [pkgs.gojq];} ''
gojq --yaml-input < "${f}" > "$out"
'';
in
builtins.fromJSON (builtins.readFile jsonFile);
vividYaml = let
f = flavor: fromYAMLfile "${pkgs.vivid.src}/themes/catppuccin-${flavor}.yml";
in {
latte = builtins.toJSON (f "latte");
mocha = builtins.toJSON (lib.recursiveUpdate (f "mocha") {colors = removeHashes overrides.mocha;});
};
vividBuilder = flavor:
pkgs.runCommand "vivid-${flavor}" {
nativeBuildInputs = [pkgs.vivid];
} ''
echo '${builtins.getAttr flavor vividYaml}' > flavor.yml
cat ./flavor.yml
vivid generate ./flavor.yml > $out
'';
vividLatte = vividBuilder "latte";
vividMocha = vividBuilder "mocha";
in {
config = lib.mkIf config.isGraphical {
home.packages = [
@ -42,8 +100,12 @@ in {
programs.zsh = {
initExtra = ''
zadm_sync() {
export STARSHIP_CONFIG__PALETTE="catppuccin_$(dark-mode-ternary mocha latte)"
export BAT_THEME="Catppuccin $(dark-mode-ternary Mocha Latte)"
BAT_THEME="Catppuccin $(dark-mode-ternary Mocha Latte)"
LS_COLORS="$(cat $(dark-mode-ternary ${vividMocha} ${vividLatte}))"
STARSHIP_CONFIG__PALETTE="catppuccin_$(dark-mode-ternary mocha latte)"
export BAT_THEME LS_COLORS STARSHIP_CONFIG__PALETTE
fast-theme "XDG:catppuccin-$(dark-mode-ternary mocha latte)" >/dev/null
}
add-zsh-hook precmd zadm_sync

View file

@ -1,11 +1,15 @@
@import url(//dablulite.github.io/css-snippets/ConsistentChatbar/import.css);
@import url('https://fonts.googleapis.com/css2?family=Play:wght@400;700&display=swap');
@import url('//fonts.googleapis.com/css2?family=IBM+Plex+Mono:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500;1,600;1,700&family=IBM+Plex+Sans:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500;1,600;1,700&family=IBM+Plex+Serif:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500;1,600;1,700&display=swap');
:root {
--font-primary: "Play", sans-serif;
--font-headline: "Play", sans-serif;
--font-display: "Play", sans-serif;
--font-code: "Berkeley Mono", "Symbols Nerd Font", mono;
--font-primary: "IBM Plex Sans", sans-serif;
--font-headline: "IBM Plex Sans", sans-serif;
--font-display: "IBM Plex Sans", sans-serif;
--font-code: "Berkeley Mono", "IBM Plex Mono", "Symbols Nerd Font", mono;
}
div[class*="messageContent__"] {
font-family: "IBM Plex Serif", serif;
}
@media (max-width: 1024px) {

View file

@ -110,6 +110,17 @@ in {
direnv.enable = true;
direnv.nix-direnv.enable = true;
eza = {
enable = true;
icons = true;
extraOptions = [
"--group"
"--group-directories-first"
"--no-permissions"
"--octal-permissions"
];
};
fzf = {
enable = true;
colors = {
@ -129,38 +140,6 @@ in {
less.enable = true;
lsd = {
enable = true;
enableAliases = true;
settings = {
classic = false;
blocks = ["permission" "user" "group" "size" "date" "name"];
date = "+%y.%m.%d %H:%M";
dereference = false;
ignore-globs = [".git"];
color = {
when = "auto";
theme = "custom";
};
icons = {
when = "auto";
theme = "fancy";
separator = " ";
};
header = false;
hyperlink = "auto";
indicators = true;
layout = "grid";
permission = "octal";
size = "default";
sorting = {
column = "name";
dir-grouping = "first";
};
symlink-arrow = "󰌷";
};
};
nix-index-database.comma.enable = true;
starship = {
@ -227,11 +206,21 @@ in {
];
shellAliases = {
cat = "bat";
ls = "eza";
ll = "eza -l";
la = "eza -a";
lt = "eza -T";
lla = "eza -la";
llt = "eza -lT";
cp = "cp -i";
mv = "mv -i";
rm = "rm -i";
# switch between yubikeys for the same GPG key
switch_yubikeys = ''gpg-connect-agent "scd serialno" "learn --force" "/bye"'';
# podman
docker = "podman";
docker-compose = "podman-compose";