From 88519e1c98e0763e55373e76b546290ea15596f1 Mon Sep 17 00:00:00 2001 From: Ivan Malison Date: Thu, 5 Aug 2021 19:06:57 -0600 Subject: [PATCH] [NixOS] Use starship instead of spaceship-prompt --- dotfiles/config/starship.toml | 6 ++++++ nixos/environment.nix | 26 +++++++++++++++++++++++++- nixos/nixpkgs | 2 +- 3 files changed, 32 insertions(+), 2 deletions(-) create mode 100644 dotfiles/config/starship.toml diff --git a/dotfiles/config/starship.toml b/dotfiles/config/starship.toml new file mode 100644 index 00000000..39113f18 --- /dev/null +++ b/dotfiles/config/starship.toml @@ -0,0 +1,6 @@ +# Inserts a blank line between shell prompts +add_newline = true + +# Replace the "❯" symbol in the prompt with "➜" +[character] # The name of the module we are configuring is "character" +success_symbol = "[➜](bold green)" # The "success_symbol" segment is being set to "➜" with the color "bold green" diff --git a/nixos/environment.nix b/nixos/environment.nix index 144441e9..b64cec91 100644 --- a/nixos/environment.nix +++ b/nixos/environment.nix @@ -20,7 +20,6 @@ with lib; enable = true; plugins = [ "git" "sudo" "pip" ]; }; - spaceship-prompt.enable = true; shellInit = '' fpath+="${libDir}/functions" for file in "${libDir}/functions/"* @@ -30,9 +29,34 @@ with lib; ''; }; + programs.starship = { + enableBashIntegration = true; + enableZshIntegration = true; + enable = true; + }; + environment = { homeBinInPath = true; localBinInPath = true; + interactiveShellInit = '' + vterm_printf(){ + if [ -n "$TMUX" ] && ([ "''${TERM%%-*}" = "tmux" ] || [ "''${TERM%%-*}" = "screen" ] ); then + # Tell tmux to pass the escape sequences through + printf "\ePtmux;\e\e]%s\007\e\\" "$1" + elif [ "''${TERM%%-*}" = "screen" ]; then + # GNU screen (screen, screen-256color, screen-256color-bce) + printf "\eP\e]%s\007\e\\" "$1" + else + printf "\e]%s\e\\" "$1" + fi + } + if [[ "$INSIDE_EMACS" = 'vterm' ]] \ + && [[ -n ''${EMACS_VTERM_PATH} ]] \ + && [[ -f ''${EMACS_VTERM_PATH}/etc/emacs-vterm-bash.sh ]]; then + source ''${EMACS_VTERM_PATH}/etc/emacs-vterm-bash.sh + fi + export STARSHIP_INSIDE_EMACS="yes" + ''; extraInit = '' export ROFI_SYSTEMD_TERM="alacritty -e" export PATH="${libDir}/bin:$PATH" diff --git a/nixos/nixpkgs b/nixos/nixpkgs index b489ee61..4dc506e2 160000 --- a/nixos/nixpkgs +++ b/nixos/nixpkgs @@ -1 +1 @@ -Subproject commit b489ee61aeb6a993deba88ce8e205b50a3ddcc0d +Subproject commit 4dc506e273b9c2f29b3f07631bf8f2bc9ed01802