feat: add starship module
This commit is contained in:
parent
4200b44e62
commit
d510f52aba
4 changed files with 62 additions and 9 deletions
60
modules/home-manager/cli/starship/default.nix
Normal file
60
modules/home-manager/cli/starship/default.nix
Normal file
|
@ -0,0 +1,60 @@
|
|||
{ lib, config, ... }:
|
||||
with lib;
|
||||
let
|
||||
cfg = config.modules.cli.starship;
|
||||
in
|
||||
{
|
||||
options.modules.cli.starship = {
|
||||
enable = mkEnableOption "enable starship prompt";
|
||||
};
|
||||
config = mkIf cfg.enable {
|
||||
programs.starship = {
|
||||
enable = true;
|
||||
enableZshIntegration = true;
|
||||
settings = {
|
||||
format = "$username$hostname$directory$git_branch$git_state$git_status$cmd_duration$line_break $python$nix_shell$character";
|
||||
directory = {
|
||||
style = "blue";
|
||||
truncate_to_repo = false;
|
||||
};
|
||||
character = {
|
||||
success_symbol = "[](purple)";
|
||||
error_symbol = "[](red)";
|
||||
vimcmd_symbol = "[](green)";
|
||||
};
|
||||
git_branch = {
|
||||
format = "[$branch]($style)";
|
||||
style = "bright-black";
|
||||
};
|
||||
git_status = {
|
||||
format = "[[( *$conflicted$untracked$modified$staged$renamed$deleted)](218) ($ahead_behind$stashed)]($style) ";
|
||||
style = "cyan";
|
||||
conflicted = "";
|
||||
untracked = "";
|
||||
modified = "";
|
||||
staged = "";
|
||||
renamed = "";
|
||||
deleted = "";
|
||||
stashed = "≡";
|
||||
};
|
||||
git_state = {
|
||||
format = "\\([$state( $progress_current/$progress_total)]($style)\\)";
|
||||
style = "bright-black";
|
||||
};
|
||||
cmd_duration = {
|
||||
format = "[$duration]($style) ";
|
||||
style = "yellow";
|
||||
};
|
||||
python = {
|
||||
format = "[$virtualenv]($style) ";
|
||||
style = "bright-black";
|
||||
};
|
||||
nix_shell = {
|
||||
format = "[$symbol$name]($style) ";
|
||||
symbol = " ";
|
||||
style = "bright-black";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
|
@ -89,15 +89,6 @@ in
|
|||
compinit -C
|
||||
'';
|
||||
plugins = [
|
||||
{
|
||||
name = "pure";
|
||||
src = pkgs.fetchFromGitHub {
|
||||
owner = "sindresorhus";
|
||||
repo = "pure";
|
||||
rev = "v1.22.0";
|
||||
hash = "sha256-TR4CyBZ+KoZRs9XDmWE5lJuUXXU1J8E2Z63nt+FS+5w=";
|
||||
};
|
||||
}
|
||||
{
|
||||
name = "base16-shell";
|
||||
src = pkgs.fetchFromGitHub {
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
./cli/ghq/default.nix
|
||||
./cli/git
|
||||
./cli/neovim
|
||||
./cli/starship
|
||||
./cli/utils
|
||||
./cli/vifm
|
||||
./cli/zsh
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue