2015-08-23 00:48:35 +00:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
##
|
2016-10-20 18:54:38 +00:00
|
|
|
with import <stockholm/lib>;
|
2015-08-23 00:48:35 +00:00
|
|
|
let
|
|
|
|
mainUser = config.krebs.build.user.name;
|
|
|
|
in
|
|
|
|
{
|
|
|
|
users.extraUsers.${mainUser}.shell = "/run/current-system/sw/bin/zsh";
|
2015-12-15 14:33:34 +00:00
|
|
|
programs.zsh= {
|
|
|
|
enable = true;
|
|
|
|
interactiveShellInit = ''
|
|
|
|
HISTSIZE=900001
|
|
|
|
HISTFILESIZE=$HISTSIZE
|
|
|
|
SAVEHIST=$HISTSIZE
|
|
|
|
|
|
|
|
setopt HIST_IGNORE_ALL_DUPS
|
|
|
|
setopt HIST_IGNORE_SPACE
|
|
|
|
setopt HIST_FIND_NO_DUPS
|
|
|
|
bindkey -e
|
|
|
|
# shift-tab
|
|
|
|
bindkey '^[[Z' reverse-menu-complete
|
2016-01-13 22:20:40 +00:00
|
|
|
bindkey "\e[3~" delete-char
|
2015-12-15 14:33:34 +00:00
|
|
|
zstyle ':completion:*' menu select
|
2015-12-16 10:40:48 +00:00
|
|
|
|
2016-07-22 10:35:06 +00:00
|
|
|
${pkgs.gnupg}/bin/gpg-connect-agent updatestartuptty /bye >/dev/null
|
2016-07-21 00:04:45 +00:00
|
|
|
GPG_TTY=$(tty)
|
|
|
|
export GPG_TTY
|
2017-01-11 10:01:30 +00:00
|
|
|
LS_COLORS=$LS_COLORS:'di=1;31:' ; export LS_COLORS
|
|
|
|
|
2016-07-21 00:04:45 +00:00
|
|
|
unset SSH_AGENT_PID
|
|
|
|
export SSH_AUTH_SOCK="/run/user/$UID/gnupg/S.gpg-agent.ssh"
|
2015-12-15 14:33:34 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
promptInit = ''
|
|
|
|
RPROMPT=""
|
|
|
|
autoload colors && colors
|
|
|
|
case $UID in
|
|
|
|
0) PROMPT="%{$fg[red]%}%~%{$reset_color%} " ;;
|
|
|
|
9001) PROMPT="%{$fg[green]%}%~%{$reset_color%} " ;;
|
|
|
|
*) PROMPT="%{$fg[yellow]%}%n %{$fg[green]%}%~%{$reset_color%} " ;;
|
|
|
|
esac
|
|
|
|
if test -n "$SSH_CLIENT"; then
|
|
|
|
PROMPT="%{$fg[magenta]%}%m $PROMPT"
|
|
|
|
fi
|
|
|
|
'';
|
|
|
|
};
|
2017-05-19 09:53:44 +00:00
|
|
|
|
|
|
|
krebs.per-user.${mainUser}.packages = [
|
|
|
|
pkgs.nix-zsh-completions
|
|
|
|
];
|
2015-08-23 00:48:35 +00:00
|
|
|
}
|