This commit is contained in:
Hadi
2024-05-02 15:40:12 +02:00
parent 92ec6a5ea8
commit 81ab14b256
86 changed files with 227 additions and 146 deletions

View File

@@ -0,0 +1,8 @@
{
imports = [
./fzf.nix
./zsh.nix
./starship.nix
./zoxide.nix
];
}

24
home/system/shell/fzf.nix Normal file
View File

@@ -0,0 +1,24 @@
{ config, ... }: {
programs.fzf = {
enable = true;
enableZshIntegration = true;
colors = {
"fg+" = config.theme.colors.primary-ansi-16;
"bg+" = "-1";
"fg" = "white";
"bg" = "-1";
"prompt" = "grey";
"pointer" = config.theme.colors.primary-ansi-16;
};
defaultOptions = [
"--margin=1"
"--layout=reverse"
"--border=rounded"
"--info='hidden'"
"--header=''"
"--prompt='/ '"
"-i"
"--no-bold"
];
};
}

View File

@@ -0,0 +1,42 @@
{ config, lib, ... }: {
programs.starship = {
enable = true;
settings = {
add_newline = true;
format = lib.concatStrings [
"$directory"
"$git_branch"
"$git_state"
"$git_status"
"$character"
];
directory = { style = "#${config.theme.colors.primary-bg}"; };
character = {
success_symbol = "[](#${config.theme.colors.primary-bg})";
error_symbol = "[](red)";
vimcmd_symbol = "[](cyan)";
};
git_branch = {
format = "[$branch]($style)";
style = "bright-black";
};
git_status = {
format =
"[[(*$conflicted$untracked$modified$staged$renamed$deleted)](218) ($ahead_behind$stashed)]($style)";
style = "cyan";
conflicted = "";
renamed = "";
deleted = "";
stashed = "";
};
git_state = {
format = "([$state( $progress_current/$progress_total)]($style)) ";
style = "bright-black";
};
};
};
}

View File

@@ -0,0 +1,6 @@
{
programs.zoxide = {
enable= true;
enableZshIntegration = true;
};
}

49
home/system/shell/zsh.nix Normal file
View File

@@ -0,0 +1,49 @@
{ pkgs, lib, config, ... }: {
home.packages = with pkgs; [ eza bat ripgrep tldr ];
programs.zsh = {
enable = true;
enableCompletion = true;
autosuggestion.enable = true;
syntaxHighlighting.enable = true;
historySubstringSearch.enable = true;
# If the variable config.theme.print-neofetch is set to true, neofetch will be printed
initExtraFirst = ''
bindkey -e
${if config.theme.print-neofetch then
pkgs.neofetch + "/bin/neofetch"
else
""}
'';
history = {
ignoreDups = true;
save = 1000000;
size = 1000000;
};
profileExtra = lib.optionalString (config.home.sessionPath != [ ]) ''
export PATH="$PATH''${PATH:+:}${
lib.concatStringsSep ":" config.home.sessionPath
}"
'';
shellAliases = {
vim = "nvim";
v = "nvim";
c = "clear";
clera = "clear";
celar = "clear";
e = "exit";
cd = "z";
ls = "${pkgs.eza}/bin/eza --icons=always";
sl = "ls";
open = "${pkgs.xdg_utils}/bin/xdg-open";
icat = "${pkgs.kitty}/bin/kitty +kitten icat";
note = "vim ~/Nextcloud/obsidian";
obs = "vim ~/Nextcloud/obsidian";
};
};
}