stockholm/makefu/2configs/zsh-user.nix
makefu c8c6c2e6c7
ma home-manager: init direnv,bat and more
move old zsh confi to home-manager
2018-12-31 10:10:39 +01:00

29 lines
692 B
Nix

{ config, lib, pkgs, ... }:
let
mainUser = config.krebs.build.user.name;
in
{
programs.zsh= {
enable = true;
enableCompletion = false; #manually at the end
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
'';
};
users.users.${mainUser} = {
shell = "/run/current-system/sw/bin/zsh";
packages = [ pkgs.nix-zsh-completions ];
};
}