nixos-config/home-manager/shell.nix

83 lines
2.1 KiB
Nix
Raw Normal View History

2024-08-22 21:07:47 +02:00
{ pkgs, common, ... }:
2024-06-24 21:53:35 +02:00
{
2024-08-22 21:07:47 +02:00
programs.zsh = {
2024-06-24 21:53:35 +02:00
enable = true;
2024-08-22 21:07:47 +02:00
enableCompletion = false; # manage completions ourself
dotDir = ".config/zsh";
2024-08-29 00:28:29 +02:00
history.share = false;
2024-06-24 21:53:35 +02:00
shellAliases = {
x = "startx";
rm = "rm -i";
cal = "cal -m";
2024-08-22 22:03:04 +02:00
ls = "ls --color";
2024-08-27 14:30:04 +02:00
cd = "z";
2024-06-24 21:53:35 +02:00
};
2024-08-22 21:07:47 +02:00
envExtra = ''
2024-08-27 17:00:16 +02:00
PROMPT=$'%B%n%b@%B%m%b: %~\nλ '
2024-08-22 21:07:47 +02:00
export BROWSER=firefox
export XINITRC="${common.homeDir}/bin/xinitrc"
export XAUTHORITY="${common.homeDir}/.local/share/Xauthority"
export PASH_KEYID="3E4A909C8FEF6E3783699C79DFC26EF8EDAD6D71"
export QT_AUTO_SCREEN_FACTOR=1
export PATH="${common.homeDir}/bin:$PATH"
'';
2024-06-24 21:53:35 +02:00
initExtra = ''
2024-08-22 21:07:47 +02:00
autoload -Uz compinit
compinit -C
(exec compinit &)
_comp_options+=(globdots)
setopt autocd
setopt noautomenu
setopt nomenucomplete
2024-08-22 22:02:54 +02:00
setopt TRANSIENT_RPROMPT
2024-08-27 17:00:16 +02:00
nix-subcommand() {
cmd="$1"
2024-08-22 21:07:47 +02:00
shift
2024-08-27 17:00:16 +02:00
pkgs=()
for pkg in "$@"; do
shift
2024-08-27 17:00:16 +02:00
[ "$pkg" = -- ] && break
[ "$pkg" = "''${pkg##*#}" ] && pkg="nixpkgs#$pkg"
pkgs+="$pkg"
done
export NIXPKGS_ALLOW_UNFREE=1 NIXPKGS_ALLOW_BROKEN=1
2024-08-27 17:00:16 +02:00
nix "$cmd" --impure "''${pkgs[@]}" -- "$@"
}
2024-08-27 17:00:16 +02:00
shell() { nix-subcommand "shell" "$@" }
run() { nix-subcommand "run" "$@" }
build() { nix-subcommand "build" "$@" }
2024-08-28 18:22:53 +02:00
KEYTIMEOUT=1
MODE_INDICATOR_VICMD='%K{10}%F{8}%B NORMAL %k%f%b'
MODE_INDICATOR_REPLACE='%K{9}%F{8}%B REPLACE %k%f%b'
MODE_INDICATOR_SEARCH='%K{13}%F{8}%B SEARCH %k%f%b'
MODE_INDICATOR_VISUAL='%K{12}%F{8}%B VISUAL %k%f%b'
MODE_INDICATOR_VLINE='%K{12}%F{8}%B V-LINE %k%f%b'
2024-06-24 21:53:35 +02:00
'';
2024-08-22 21:07:47 +02:00
plugins = [
{
name = "zsh-vim-mode";
file = "zsh-vim-mode.plugin.zsh";
src = pkgs.fetchFromGitHub {
owner = "softmoth";
repo = "zsh-vim-mode";
rev = "1f9953b7d6f2f0a8d2cb8e8977baa48278a31eab";
sha256 = "sha256-a+6EWMRY1c1HQpNtJf5InCzU7/RphZjimLdXIXbO6cQ=";
};
}
];
2024-06-24 21:53:35 +02:00
};
programs.direnv = {
enable = true;
nix-direnv.enable = true;
};
2024-08-27 14:30:04 +02:00
programs.zoxide = {
enable = true;
};
2024-06-24 21:53:35 +02:00
}