2023-01-31 09:38:11 +01:00
|
|
|
{
|
2023-02-10 07:46:37 +01:00
|
|
|
config,
|
|
|
|
flakePath,
|
|
|
|
lib,
|
|
|
|
pkgs,
|
|
|
|
...
|
2023-02-13 00:54:29 +01:00
|
|
|
}: let
|
|
|
|
inherit (pkgs.stdenv.hostPlatform) isDarwin;
|
2023-02-15 06:27:38 +01:00
|
|
|
symlink = fileName: {recursive ? false}: {
|
|
|
|
source = config.lib.file.mkOutOfStoreSymlink "${flakePath}/${fileName}";
|
|
|
|
recursive = recursive;
|
|
|
|
};
|
2023-02-13 00:54:29 +01:00
|
|
|
in {
|
|
|
|
home.sessionVariables = {LESSHISTFILE = "-";};
|
|
|
|
|
2023-01-31 09:38:11 +01:00
|
|
|
programs = {
|
|
|
|
direnv.enable = true;
|
|
|
|
direnv.nix-direnv.enable = true;
|
|
|
|
|
|
|
|
fzf.enable = true;
|
|
|
|
|
|
|
|
lsd = {
|
|
|
|
enable = true;
|
|
|
|
enableAliases = true;
|
|
|
|
};
|
|
|
|
|
|
|
|
mcfly.enable = true;
|
|
|
|
|
|
|
|
starship = {
|
|
|
|
enable = true;
|
2023-02-15 06:27:38 +01:00
|
|
|
package = pkgs.unstable.starship;
|
2023-01-31 09:38:11 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
tealdeer = {
|
|
|
|
enable = true;
|
|
|
|
settings.updates.auto_update = true;
|
|
|
|
};
|
|
|
|
|
|
|
|
zoxide.enable = true;
|
|
|
|
|
|
|
|
zsh = {
|
|
|
|
enable = true;
|
|
|
|
enableAutosuggestions = true;
|
|
|
|
enableCompletion = true;
|
|
|
|
enableSyntaxHighlighting = true;
|
|
|
|
|
|
|
|
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-01-31 09:38:11 +01:00
|
|
|
for conf in "${functionsDir}"/**/*.zsh; do
|
|
|
|
source "$conf"
|
|
|
|
done
|
|
|
|
'';
|
|
|
|
|
|
|
|
envExtra = ''
|
|
|
|
export PATH="$PATH:${config.xdg.dataHome}/krew/bin"
|
2023-02-08 10:04:55 +01:00
|
|
|
export ZVM_INIT_MODE=sourcing
|
2023-01-31 09:38:11 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
dotDir = ".config/zsh";
|
|
|
|
oh-my-zsh = {
|
|
|
|
enable = true;
|
|
|
|
plugins = [
|
|
|
|
"colored-man-pages"
|
|
|
|
"colorize"
|
|
|
|
"docker-compose"
|
|
|
|
"git"
|
|
|
|
"kubectl"
|
|
|
|
];
|
|
|
|
};
|
|
|
|
plugins = [
|
|
|
|
{
|
|
|
|
name = "zsh-vi-mode";
|
|
|
|
src = pkgs.zsh-vi-mode;
|
|
|
|
file = "share/zsh-vi-mode/zsh-vi-mode.plugin.zsh";
|
|
|
|
}
|
|
|
|
{
|
|
|
|
name = "zsh-nix-shell";
|
|
|
|
file = "nix-shell.plugin.zsh";
|
2023-02-08 10:04:55 +01:00
|
|
|
src = pkgs.fetchFromGitHub {
|
|
|
|
owner = "chisui";
|
|
|
|
repo = "zsh-nix-shell";
|
|
|
|
rev = "v0.5.0";
|
|
|
|
sha256 = "0za4aiwwrlawnia4f29msk822rj9bgcygw6a8a6iikiwzjjz0g91";
|
|
|
|
};
|
2023-01-31 09:38:11 +01:00
|
|
|
}
|
|
|
|
];
|
|
|
|
shellAliases = {
|
2023-02-13 00:54:29 +01:00
|
|
|
cat =
|
|
|
|
if isDarwin
|
2023-02-15 06:40:45 +01:00
|
|
|
then "bat --theme=\$(defaults read -globalDomain AppleInterfaceStyle &> /dev/null && echo Catppuccin-mocha || echo Catppuccin-latte)"
|
2023-02-13 00:54:29 +01:00
|
|
|
else "bat";
|
2023-02-15 06:40:45 +01:00
|
|
|
# switch between yubikeys for the same GPG key
|
2023-02-10 07:46:37 +01:00
|
|
|
switch_yubikeys = "gpg-connect-agent \"scd serialno\" \"learn --force\" /bye";
|
2023-01-31 09:38:11 +01:00
|
|
|
};
|
|
|
|
history = {
|
|
|
|
path = "${config.xdg.configHome}/zsh/history";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
xdg.configFile = {
|
2023-02-15 06:27:38 +01:00
|
|
|
"lsd" = symlink "modules/lsd" {recursive = true;};
|
|
|
|
"starship.toml" = symlink "modules/starship/config.toml" {};
|
|
|
|
"zsh/functions" = symlink "modules/zsh/functions" {recursive = true;};
|
2023-01-31 09:38:11 +01:00
|
|
|
};
|
|
|
|
}
|