2023-01-31 09:38:11 +01:00
|
|
|
{
|
2023-02-10 07:46:37 +01:00
|
|
|
config,
|
|
|
|
flakePath,
|
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
|
2023-02-15 06:27:38 +01:00
|
|
|
symlink = fileName: {recursive ? false}: {
|
|
|
|
source = config.lib.file.mkOutOfStoreSymlink "${flakePath}/${fileName}";
|
|
|
|
recursive = recursive;
|
|
|
|
};
|
2023-05-16 16:20:11 +02:00
|
|
|
zshPlugins = plugins: (map (plugin: rec {
|
|
|
|
name = src.name;
|
|
|
|
inherit (plugin) file src;
|
|
|
|
})
|
|
|
|
plugins);
|
2023-11-15 21:02:53 +01:00
|
|
|
catppuccin-zsh-fsh = pkgs.stdenvNoCC.mkDerivation {
|
|
|
|
name = "catppuccin-zsh-fsh";
|
|
|
|
src = pkgs.fetchFromGitHub {
|
|
|
|
owner = "catppuccin";
|
|
|
|
repo = "zsh-fsh";
|
|
|
|
rev = "7cdab58bddafe0565f84f6eaf2d7dd109bd6fc18";
|
|
|
|
sha256 = "sha256-31lh+LpXGe7BMZBhRWvvbOTkwjOM77FPNaGy6d26hIA=";
|
|
|
|
};
|
|
|
|
phases = ["buildPhase"];
|
|
|
|
buildPhase = ''
|
|
|
|
mkdir -p $out/share/zsh/site-functions/themes
|
|
|
|
ls $src/themes
|
|
|
|
cp $src/themes/* $out/share/zsh/site-functions/themes/
|
|
|
|
'';
|
|
|
|
};
|
2023-02-13 00:54:29 +01:00
|
|
|
in {
|
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
|
|
|
};
|
|
|
|
};
|
2023-07-13 08:45:39 +02:00
|
|
|
bat = let
|
2023-11-02 17:10:11 +01:00
|
|
|
src = pkgs.fetchFromGitHub {
|
2023-07-13 08:45:39 +02:00
|
|
|
owner = "catppuccin";
|
|
|
|
repo = "bat";
|
|
|
|
rev = "ba4d16880d63e656acced2b7d4e034e4a93f74b1";
|
|
|
|
sha256 = "sha256-6WVKQErGdaqb++oaXnY3i6/GuH2FhTgK0v4TN4Y0Wbw=";
|
|
|
|
};
|
|
|
|
in {
|
|
|
|
enable = true;
|
|
|
|
themes = {
|
2023-11-02 17:10:11 +01:00
|
|
|
"catppuccin-latte" = {
|
|
|
|
inherit src;
|
|
|
|
file = "Catppuccin-latte.tmTheme";
|
|
|
|
};
|
|
|
|
"catppuccin-mocha" = {
|
|
|
|
inherit src;
|
|
|
|
file = "Catppuccin-mocha.tmTheme";
|
|
|
|
};
|
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;
|
|
|
|
|
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
|
|
|
|
|
|
|
lsd = {
|
|
|
|
enable = true;
|
|
|
|
enableAliases = true;
|
2024-01-06 23:58:51 +01:00
|
|
|
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 = "";
|
|
|
|
};
|
2023-01-31 09:38:11 +01:00
|
|
|
};
|
|
|
|
|
2023-03-05 14:53:36 +01:00
|
|
|
nix-index.enable = true;
|
2023-01-31 09:38:11 +01:00
|
|
|
|
2023-05-17 12:02:03 +02:00
|
|
|
starship.enable = true;
|
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;
|
|
|
|
enableAutosuggestions = true;
|
|
|
|
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
|
|
|
}
|
|
|
|
'';
|
2023-01-31 09:38:11 +01:00
|
|
|
initExtra = let
|
2023-02-10 06:34:05 +01:00
|
|
|
functionsDir = "${config.home.homeDirectory}/${config.programs.zsh.dotDir}/functions";
|
2023-02-10 07:46:37 +01:00
|
|
|
in ''
|
2023-11-02 17:10:11 +01:00
|
|
|
for script in "${functionsDir}"/**/*; do source "$script"; done
|
2023-01-31 09:38:11 +01:00
|
|
|
'';
|
2023-05-16 16:20:11 +02:00
|
|
|
envExtra = ''
|
|
|
|
export LESSHISTFILE="-"
|
|
|
|
'';
|
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 =
|
|
|
|
[
|
|
|
|
"colored-man-pages"
|
|
|
|
"colorize"
|
|
|
|
"docker"
|
|
|
|
"docker-compose"
|
|
|
|
"git"
|
|
|
|
"kubectl"
|
|
|
|
]
|
|
|
|
++ lib.optionals pkgs.stdenv.isDarwin [
|
|
|
|
"dash"
|
|
|
|
"macos"
|
|
|
|
];
|
2023-01-31 09:38:11 +01:00
|
|
|
};
|
2023-05-16 16:20:11 +02:00
|
|
|
plugins = with pkgs; (zshPlugins [
|
2023-01-31 09:38:11 +01:00
|
|
|
{
|
2023-11-02 17:10:11 +01:00
|
|
|
src = zsh-vi-mode.overrideAttrs (old: {
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
inherit (old.src) repo owner;
|
|
|
|
rev = "a3d717831c1864de8eabf20b946d66afc67e6695";
|
|
|
|
hash = "sha256-peoyY+krpK/7dA3TW6PEpauDwZLe+riVWfwpFYnRn1Q=";
|
|
|
|
};
|
|
|
|
});
|
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
|
|
|
}
|
|
|
|
{
|
2023-05-16 16:20:11 +02:00
|
|
|
src = 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
|
|
|
{
|
2023-07-13 08:45:39 +02:00
|
|
|
src = zsh-fast-syntax-highlighting.overrideAttrs (old: {
|
|
|
|
src = fetchFromGitHub {
|
2023-11-02 17:10:11 +01:00
|
|
|
inherit (old.src) repo owner;
|
2023-07-13 08:45:39 +02:00
|
|
|
rev = "cf318e06a9b7c9f2219d78f41b46fa6e06011fd9";
|
|
|
|
hash = "sha256-RVX9ZSzjBW3LpFs2W86lKI6vtcvDWP6EPxzeTcRZua4=";
|
|
|
|
};
|
|
|
|
});
|
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
|
|
|
}
|
2023-05-16 16:20:11 +02:00
|
|
|
]);
|
2023-01-31 09:38:11 +01:00
|
|
|
shellAliases = {
|
2023-06-22 01:09:01 +02:00
|
|
|
cp = "cp -i";
|
|
|
|
mv = "mv -i";
|
|
|
|
rm = "rm -i";
|
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"'';
|
2023-05-15 01:03:09 +02:00
|
|
|
tree = "lsd --tree";
|
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
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
xdg.configFile = {
|
2023-11-15 21:02:53 +01:00
|
|
|
"fsh".source = "${catppuccin-zsh-fsh}/share/zsh/site-functions/themes";
|
2023-02-19 00:18:25 +01:00
|
|
|
"starship.toml" = symlink "home/apps/starship/config.toml" {};
|
|
|
|
"zsh/functions" = symlink "home/apps/zsh/functions" {recursive = true;};
|
2023-01-31 09:38:11 +01:00
|
|
|
};
|
|
|
|
}
|