forked from mirrors_public/oddlama_nix-config
refactor: split "real" modules and "config" modules
This commit is contained in:
parent
045f15239a
commit
cceae6c63c
60 changed files with 126 additions and 113 deletions
64
users/config/shell/zsh/default.nix
Normal file
64
users/config/shell/zsh/default.nix
Normal file
|
@ -0,0 +1,64 @@
|
|||
{
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
# Needed in path for zsh-histdb
|
||||
home.packages = [pkgs.sqlite];
|
||||
|
||||
programs.zsh = {
|
||||
enable = true;
|
||||
envExtra = ''
|
||||
umask 077
|
||||
'';
|
||||
dotDir = ".config/zsh";
|
||||
history = {
|
||||
path = "\${XDG_DATA_HOME-$HOME/.local/share}/zsh/history";
|
||||
save = 1000500;
|
||||
size = 1000000;
|
||||
};
|
||||
initExtra = lib.readFile ./zshrc;
|
||||
initExtraFirst = ''
|
||||
HISTDB_FILE=''${XDG_DATA_HOME-$HOME/.local/share}/zsh/history.db
|
||||
|
||||
# Do this early so fast-syntax-highlighting can wrap and override this
|
||||
if autoload history-search-end; then
|
||||
zle -N history-beginning-search-backward-end history-search-end
|
||||
zle -N history-beginning-search-forward-end history-search-end
|
||||
fi
|
||||
'';
|
||||
plugins = [
|
||||
{
|
||||
# Must be before plugins that wrap widgets, such as zsh-autosuggestions or fast-syntax-highlighting
|
||||
name = "fzf-tab";
|
||||
src = "${pkgs.zsh-fzf-tab}/share/fzf-tab";
|
||||
}
|
||||
{
|
||||
name = "fast-syntax-highlighting";
|
||||
src = "${pkgs.zsh-fast-syntax-highlighting}/share/zsh/site-functions";
|
||||
}
|
||||
{
|
||||
name = "zsh-autosuggestions";
|
||||
file = "zsh-autosuggestions.zsh";
|
||||
src = "${pkgs.zsh-autosuggestions}/share/zsh-autosuggestions";
|
||||
}
|
||||
{
|
||||
name = "zsh-histdb";
|
||||
src = pkgs.fetchFromGitHub {
|
||||
owner = "larkery";
|
||||
repo = "zsh-histdb";
|
||||
rev = "30797f0c50c31c8d8de32386970c5d480e5ab35d";
|
||||
hash = "sha256-PQIFF8kz+baqmZWiSr+wc4EleZ/KD8Y+lxW2NT35/bg=";
|
||||
};
|
||||
}
|
||||
{
|
||||
name = "zsh-histdb-skim";
|
||||
src = "${pkgs.zsh-histdb-skim}/share/zsh-histdb-skim";
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
home.persistence."/persist".directories = [
|
||||
".local/share/zsh" # History
|
||||
];
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue