From 9137b5bf031843f2c3e716e31f886195a5a435da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cyryl=20P=C5=82otnicki?= Date: Sat, 4 Jul 2020 10:21:15 +0100 Subject: [PATCH] move to starship --- nixos/cli.nix | 1 + nixos/programs/zsh.nix | 84 +++++++++++++++++++++++++----------------- 2 files changed, 51 insertions(+), 34 deletions(-) diff --git a/nixos/cli.nix b/nixos/cli.nix index 93ce781f..9fbaf13c 100644 --- a/nixos/cli.nix +++ b/nixos/cli.nix @@ -17,5 +17,6 @@ docker-compose rustup knockknock python38Packages.pygments + canto-curses ]; } diff --git a/nixos/programs/zsh.nix b/nixos/programs/zsh.nix index 5819ce8e..4f9f46cd 100644 --- a/nixos/programs/zsh.nix +++ b/nixos/programs/zsh.nix @@ -16,25 +16,11 @@ enable = true; plugins = [ "vi-mode" "git" "python" "history-substring-search" "tmux" ]; }; - plugins = [ - { - name = "spaceship"; - file = "spaceship.zsh"; - src = pkgs.fetchgit { - url = "https://github.com/denysdovhan/spaceship-prompt"; - rev = "v3.11.1"; - sha256 = "0habry3r6wfbd9xbhw10qfdar3h5chjffr5pib4bx7j4iqcl8lw8"; - }; - }]; - initExtra = '' - SPACESHIP_TIME_SHOW=true - SPACESHIP_EXIT_CODE_SHOW=true - SPACESHIP_VI_MODE_SHOW=false - SPACESHIP_BATTERY_THRESHOLD=30 + initExtra = '' ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE='fg=238' setopt HIST_IGNORE_ALL_DUPS - ''; - profileExtra = '' + ''; + profileExtra = '' export PATH="$HOME/programs:$PATH"; export PATH="$HOME/tools:$PATH"; export PATH="$HOME/bin:$PATH"; @@ -43,8 +29,8 @@ export PATH="$HOME/.rvm/bin:$PATH"; export PATH="$HOME/.cargo/bin:$PATH"; export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH"; - ''; - envExtra = '' + ''; + envExtra = '' [ -s "/home/cyryl/.jabba/jabba.sh" ] && source "/home/cyryl/.jabba/jabba.sh" local nixos_version=`which nixos-version` if [[ ! -x "$nixos_version" ]]; then @@ -54,19 +40,49 @@ [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" echo "non-nixos patches loaded" fi - ''; - sessionVariables = { - TERM="xterm-256color"; - EDITOR="vim"; - VISUAL="vim"; - PAGER="less"; - ZSH_TMUX_AUTOSTART=true; - GOPATH="$HOME/go"; - }; - shellAliases = { tmate = "tmux detach-client -E 'tmate;tmux'"; cat = "bat -p"; }; + ''; + sessionVariables = { + TERM="xterm-256color"; + EDITOR="vim"; + VISUAL="vim"; + PAGER="less"; + ZSH_TMUX_AUTOSTART=true; + GOPATH="$HOME/go"; }; - programs.direnv = { - enable = true; - enableZshIntegration = true; - }; - } + shellAliases = { tmate = "tmux detach-client -E 'tmate;tmux'"; cat = "bat -p"; }; + }; + programs.direnv = { + enable = true; + enableZshIntegration = true; + }; + + home.file.".config/starship.toml".text ='' + [aws] + disabled = true + + [[battery.display]] + threshold = 10 + style = "bold red" + + [[battery.display]] + threshold = 30 + style = "bold yellow" + + [memory_usage] + disabled = false + + [git_branch] + symbol = "git " + + [hg_branch] + symbol = "hg " + + [nix_shell] + symbol = "nix-shell " + ''; + + programs.starship = { + enable = true; + enableZshIntegration = true; + }; +}