2023-01-31 09:38:11 +01:00
|
|
|
{
|
2023-02-10 07:46:37 +01:00
|
|
|
config,
|
2023-09-03 00:48:39 +02:00
|
|
|
lib,
|
2023-02-10 07:46:37 +01:00
|
|
|
pkgs,
|
|
|
|
...
|
2023-02-13 00:54:29 +01:00
|
|
|
}: let
|
2024-05-02 20:06:56 +02:00
|
|
|
inherit (pkgs.stdenv) isLinux;
|
2024-02-15 18:49:22 +01:00
|
|
|
srcs = pkgs.callPackage ../../_sources/generated.nix {};
|
2023-05-16 16:20:11 +02:00
|
|
|
zshPlugins = plugins: (map (plugin: rec {
|
|
|
|
name = src.name;
|
|
|
|
inherit (plugin) file src;
|
|
|
|
})
|
|
|
|
plugins);
|
2023-02-13 00:54:29 +01:00
|
|
|
in {
|
2024-03-13 09:08:27 +01:00
|
|
|
home.sessionVariables = {
|
|
|
|
LESS = "-R --use-color";
|
|
|
|
LESSHISTFILE = "-";
|
|
|
|
MANPAGER = "sh -c 'col -bx | bat -l man -p'";
|
|
|
|
};
|
2024-05-02 20:06:56 +02:00
|
|
|
home.packages = [pkgs.onefetch];
|
2024-03-13 09:08:27 +01:00
|
|
|
|
2023-01-31 09:38:11 +01:00
|
|
|
programs = {
|
2023-05-16 16:20:11 +02:00
|
|
|
atuin = {
|
|
|
|
enable = true;
|
|
|
|
flags = ["--disable-up-arrow"];
|
|
|
|
settings = {
|
|
|
|
inline_height = 30;
|
|
|
|
style = "compact";
|
2023-07-08 04:36:22 +02:00
|
|
|
sync_address = "https://atuin.winston.sh";
|
|
|
|
sync_frequency = "5m";
|
2023-05-16 16:20:11 +02:00
|
|
|
};
|
|
|
|
};
|
2024-02-15 18:49:22 +01:00
|
|
|
bat = {
|
2023-07-13 08:45:39 +02:00
|
|
|
enable = true;
|
|
|
|
themes = {
|
2024-03-07 13:40:26 +01:00
|
|
|
"Catppuccin Latte" = {
|
2024-04-27 02:07:37 +02:00
|
|
|
src = "${srcs.catppuccin-bat.src}/themes";
|
2024-03-10 23:57:29 +01:00
|
|
|
file = "Catppuccin Latte.tmTheme";
|
2023-11-02 17:10:11 +01:00
|
|
|
};
|
2024-03-07 13:40:26 +01:00
|
|
|
"Catppuccin Frappe" = {
|
2024-04-27 02:07:37 +02:00
|
|
|
src = "${srcs.catppuccin-bat.src}/themes";
|
2024-03-10 23:57:29 +01:00
|
|
|
file = "Catppuccin Frappe.tmTheme";
|
2024-03-07 13:40:26 +01:00
|
|
|
};
|
|
|
|
"Catppuccin Macchiato" = {
|
2024-04-27 02:07:37 +02:00
|
|
|
src = "${srcs.catppuccin-bat.src}/themes";
|
2024-03-10 23:57:29 +01:00
|
|
|
file = "Catppuccin Macchiato.tmTheme";
|
2024-03-07 13:40:26 +01:00
|
|
|
};
|
|
|
|
"Catppuccin Mocha" = {
|
2024-04-27 02:07:37 +02:00
|
|
|
src = "${srcs.catppuccin-bat.src}/themes";
|
2024-03-10 23:57:29 +01:00
|
|
|
file = "Catppuccin Mocha.tmTheme";
|
2023-11-02 17:10:11 +01:00
|
|
|
};
|
2023-07-13 08:45:39 +02:00
|
|
|
};
|
|
|
|
};
|
2023-02-17 17:26:53 +01:00
|
|
|
btop = {
|
|
|
|
enable = true;
|
|
|
|
settings = {
|
|
|
|
theme_background = false;
|
|
|
|
vim_keys = true;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2023-01-31 09:38:11 +01:00
|
|
|
direnv.enable = true;
|
|
|
|
direnv.nix-direnv.enable = true;
|
|
|
|
|
2024-03-14 22:12:11 +01:00
|
|
|
eza = {
|
|
|
|
enable = true;
|
|
|
|
icons = true;
|
|
|
|
extraOptions = [
|
|
|
|
"--group"
|
|
|
|
"--group-directories-first"
|
|
|
|
"--no-permissions"
|
|
|
|
"--octal-permissions"
|
|
|
|
];
|
|
|
|
};
|
|
|
|
|
2023-05-15 01:03:09 +02:00
|
|
|
fzf = {
|
|
|
|
enable = true;
|
2023-05-17 12:02:03 +02:00
|
|
|
colors = {
|
|
|
|
fg = "#cdd6f4";
|
|
|
|
"fg+" = "#cdd6f4";
|
|
|
|
hl = "#f38ba8";
|
|
|
|
"hl+" = "#f38ba8";
|
|
|
|
header = "#ff69b4";
|
|
|
|
info = "#cba6f7";
|
|
|
|
marker = "#f5e0dc";
|
|
|
|
pointer = "#f5e0dc";
|
|
|
|
prompt = "#cba6f7";
|
|
|
|
spinner = "#f5e0dc";
|
|
|
|
};
|
|
|
|
defaultOptions = ["--height=30%" "--layout=reverse" "--info=inline"];
|
2023-05-15 01:03:09 +02:00
|
|
|
};
|
2023-01-31 09:38:11 +01:00
|
|
|
|
2024-03-13 09:08:27 +01:00
|
|
|
less.enable = true;
|
|
|
|
|
|
|
|
nix-index-database.comma.enable = true;
|
2023-01-31 09:38:11 +01:00
|
|
|
|
2024-02-15 18:49:22 +01:00
|
|
|
starship = {
|
|
|
|
enable = true;
|
|
|
|
settings = builtins.fromTOML (builtins.readFile ./starship/config.toml);
|
|
|
|
};
|
2023-01-31 09:38:11 +01:00
|
|
|
|
|
|
|
tealdeer = {
|
|
|
|
enable = true;
|
2023-03-16 12:51:20 +01:00
|
|
|
settings = {
|
|
|
|
style = {
|
|
|
|
description.foreground = "white";
|
|
|
|
command_name.foreground = "green";
|
|
|
|
example_text.foreground = "blue";
|
|
|
|
example_code.foreground = "white";
|
|
|
|
example_variable.foreground = "yellow";
|
|
|
|
};
|
|
|
|
updates.auto_update = true;
|
|
|
|
};
|
2023-01-31 09:38:11 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
zoxide.enable = true;
|
|
|
|
|
|
|
|
zsh = {
|
|
|
|
enable = true;
|
2024-03-23 06:16:54 +01:00
|
|
|
autosuggestion.enable = true;
|
2023-01-31 09:38:11 +01:00
|
|
|
enableCompletion = true;
|
|
|
|
|
2023-11-02 17:10:11 +01:00
|
|
|
initExtraFirst = ''
|
|
|
|
zvm_config() {
|
2023-11-08 13:36:23 +01:00
|
|
|
ZVM_INIT_MODE=sourcing
|
|
|
|
ZVM_CURSOR_STYLE_ENABLED=false
|
|
|
|
ZVM_VI_HIGHLIGHT_BACKGROUND=black
|
2023-11-02 17:10:11 +01:00
|
|
|
ZVM_VI_HIGHLIGHT_EXTRASTYLE=bold,underline
|
2023-11-08 13:36:23 +01:00
|
|
|
ZVM_VI_HIGHLIGHT_FOREGROUND=white
|
2023-11-02 17:10:11 +01:00
|
|
|
}
|
|
|
|
'';
|
2024-05-02 20:06:56 +02:00
|
|
|
initExtra =
|
|
|
|
''
|
|
|
|
function incognito() {
|
|
|
|
if [[ -n $ZSH_INCOGNITO ]]; then
|
|
|
|
add-zsh-hook precmd _atuin_precmd
|
|
|
|
add-zsh-hook preexec _atuin_preexec
|
|
|
|
unset ZSH_INCOGNITO
|
|
|
|
else
|
|
|
|
add-zsh-hook -d precmd _atuin_precmd
|
|
|
|
add-zsh-hook -d preexec _atuin_preexec
|
|
|
|
export ZSH_INCOGNITO=1
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
onefetch_in_git_dir() {
|
|
|
|
if [[ -d '.git' ]]; then
|
|
|
|
${pkgs.onefetch}/bin/onefetch --no-merges --no-bots --no-color-palette --text-colors 1 1 3 4 4
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
add-zsh-hook chpwd onefetch_in_git_dir
|
|
|
|
''
|
|
|
|
+ lib.optionalString isLinux ''
|
|
|
|
function open() {
|
|
|
|
nohup xdg-open "$*" > /dev/null 2>&1
|
|
|
|
}
|
|
|
|
'';
|
2023-01-31 09:38:11 +01:00
|
|
|
|
|
|
|
dotDir = ".config/zsh";
|
|
|
|
oh-my-zsh = {
|
|
|
|
enable = true;
|
2023-09-03 00:48:39 +02:00
|
|
|
plugins =
|
2024-03-07 13:41:11 +01:00
|
|
|
["colored-man-pages" "colorize" "git" "kubectl"]
|
2024-02-15 18:49:22 +01:00
|
|
|
++ lib.optionals pkgs.stdenv.isDarwin ["dash" "macos"];
|
2023-01-31 09:38:11 +01:00
|
|
|
};
|
2024-02-15 18:49:22 +01:00
|
|
|
plugins = zshPlugins [
|
2023-01-31 09:38:11 +01:00
|
|
|
{
|
2024-02-15 18:49:22 +01:00
|
|
|
src = pkgs.zsh-vi-mode;
|
2023-05-16 16:20:11 +02:00
|
|
|
file = "share/zsh-vi-mode/zsh-vi-mode.plugin.zsh";
|
2023-01-31 09:38:11 +01:00
|
|
|
}
|
|
|
|
{
|
2024-02-15 18:49:22 +01:00
|
|
|
src = pkgs.zsh-nix-shell;
|
2023-02-17 17:26:53 +01:00
|
|
|
file = "share/zsh-nix-shell/nix-shell.plugin.zsh";
|
2023-01-31 09:38:11 +01:00
|
|
|
}
|
2023-05-15 01:03:09 +02:00
|
|
|
{
|
2024-02-15 18:49:22 +01:00
|
|
|
src = pkgs.zsh-fast-syntax-highlighting.overrideAttrs (_: {
|
|
|
|
src = srcs.zsh-fast-syntax-highlighting.src;
|
2023-07-13 08:45:39 +02:00
|
|
|
});
|
2023-05-16 16:20:11 +02:00
|
|
|
file = "share/zsh/site-functions/fast-syntax-highlighting.plugin.zsh";
|
2023-05-15 01:03:09 +02:00
|
|
|
}
|
2024-02-15 18:49:22 +01:00
|
|
|
];
|
2023-01-31 09:38:11 +01:00
|
|
|
shellAliases = {
|
2024-03-13 09:08:27 +01:00
|
|
|
cat = "bat";
|
2024-03-14 22:12:11 +01:00
|
|
|
|
|
|
|
ls = "eza";
|
|
|
|
ll = "eza -l";
|
|
|
|
la = "eza -a";
|
|
|
|
lt = "eza -T";
|
|
|
|
lla = "eza -la";
|
|
|
|
llt = "eza -lT";
|
|
|
|
|
2023-06-22 01:09:01 +02:00
|
|
|
cp = "cp -i";
|
|
|
|
mv = "mv -i";
|
|
|
|
rm = "rm -i";
|
2024-03-14 22:12:11 +01:00
|
|
|
|
2023-02-15 06:40:45 +01:00
|
|
|
# switch between yubikeys for the same GPG key
|
2023-05-16 16:20:11 +02:00
|
|
|
switch_yubikeys = ''gpg-connect-agent "scd serialno" "learn --force" "/bye"'';
|
2024-03-14 22:12:11 +01:00
|
|
|
|
2023-08-25 23:23:54 +02:00
|
|
|
# podman
|
|
|
|
docker = "podman";
|
|
|
|
docker-compose = "podman-compose";
|
2023-01-31 09:38:11 +01:00
|
|
|
};
|
2023-05-16 16:20:11 +02:00
|
|
|
history.path = "${config.xdg.configHome}/zsh/history";
|
2023-01-31 09:38:11 +01:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2024-04-27 02:07:37 +02:00
|
|
|
xdg.configFile."fsh".source = "${srcs.catppuccin-zsh-fsh.src}/themes";
|
2023-01-31 09:38:11 +01:00
|
|
|
}
|