diff --git a/dotfiles/starship.toml b/dotfiles/starship.toml new file mode 100644 index 0000000..192cb4b --- /dev/null +++ b/dotfiles/starship.toml @@ -0,0 +1,7 @@ +add_newline = false + +[username] +show_always = true + +[hostname] +ssh_only = false diff --git a/roles/base.nix b/roles/base.nix index 4bd2dce..b6af0a3 100644 --- a/roles/base.nix +++ b/roles/base.nix @@ -1,9 +1,8 @@ -# Do not modify this file! It was generated by ‘nixos-generate-config’ -# and may be overwritten by future invocations. Please make changes -# to /etc/nixos/configuration.nix instead. { config, lib, pkgs, ... }: -{ +let + unstable = import {}; +in { environment.systemPackages = with pkgs; [ bash bat @@ -15,13 +14,23 @@ jq ripgrep z-lua + unstable.starship (import ../packages/neovim.nix) ]; + environment = { + etc = { + "starship.toml".source = ../dotfiles/starship.toml; + }; + }; programs.bash = { + promptInit = '' + . <(starship init bash) + ''; interactiveShellInit = '' export EDITOR=nvim + export STARSHIP_CONFIG=/etc/starship.toml if [ -z "$SSH_AUTH_SOCK" ]; then eval $(ssh-agent) @@ -43,14 +52,6 @@ fi } - git_branch(){ - branch=$(git branch 2> /dev/null) || exit 0 - branch=$(sed -n '/^*/ s/* \(.*\)/\1/p' <<< $branch) - status=$(git status 2> /dev/null \ - | grep -q "nothing to commit, working tree clean" || e cho -n '*') - echo "$branch$status " - } - . "$(fzf-share)/key-bindings.bash" . "$(fzf-share)/completion.bash" . <(z --init bash)