flake: migrate users/profiles -> users/modules
This commit is contained in:
parent
85fb3f8251
commit
e50310eb80
36 changed files with 46 additions and 79 deletions
74
users/modules/global/shells/zsh.nix
Normal file
74
users/modules/global/shells/zsh.nix
Normal file
|
@ -0,0 +1,74 @@
|
|||
{ config, lib, pkgs, main, ... }: {
|
||||
imports = [ ./common.nix ];
|
||||
|
||||
programs = {
|
||||
zsh = rec {
|
||||
enable = true;
|
||||
|
||||
enableCompletion = true;
|
||||
enableVteIntegration = true;
|
||||
enableAutosuggestions = true;
|
||||
syntaxHighlighting.enable = true;
|
||||
|
||||
# defaultKeymap = "emacs";
|
||||
|
||||
initExtraFirst = ''
|
||||
[[ $TERM == "tramp" ]] && unsetopt zle && PS1='$ ' && return
|
||||
'';
|
||||
|
||||
initExtra = ''
|
||||
${pkgs.kitty}/bin/kitty + complete setup zsh | source /dev/stdin
|
||||
${pkgs.any-nix-shell}/bin/any-nix-shell zsh --info-right | source /dev/stdin
|
||||
|
||||
functions -c precmd precmd_any_nix_shell
|
||||
|
||||
precmd() {
|
||||
precmd_any_nix_shell
|
||||
|
||||
if [[ -e ~/TODO.txt && ! -v __TODO_PRINTED ]] then
|
||||
export __TODO_PRINTED=1
|
||||
echo TODO:
|
||||
\cat ~/TODO.txt
|
||||
fi
|
||||
}
|
||||
|
||||
if [[ "$(basename "$(readlink "/proc/$PPID/exe")")" == ".kitty-wrapped" ]]; then
|
||||
PATH=$(echo "$PATH" | sed 's/\/nix\/store\/[a-zA-Z._0-9-]\+\/bin:\?//g' | sed 's/:$//')
|
||||
fi
|
||||
'';
|
||||
|
||||
dotDir = ".config/zsh";
|
||||
|
||||
history.path = "$HOME/${dotDir}/.zsh_history";
|
||||
|
||||
shellAliases = main.environment.shellAliases // config.home.shellAliases;
|
||||
|
||||
oh-my-zsh = {
|
||||
enable = true;
|
||||
plugins = [
|
||||
# Display
|
||||
"colorize"
|
||||
"colored-man-pages"
|
||||
|
||||
# zsh modifications
|
||||
"zsh-interactive-cd"
|
||||
"command-not-found"
|
||||
"sudo"
|
||||
|
||||
# Aliases
|
||||
"alias-finder"
|
||||
|
||||
# Applications
|
||||
## Python
|
||||
"pip"
|
||||
## Git
|
||||
"gitignore"
|
||||
## Vim
|
||||
"fancy-ctrl-z"
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
starship.enableZshIntegration = lib.mkIf config.programs.starship.enable true;
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue