feat: add starship module

This commit is contained in:
Yorick Barbanneau 2024-05-16 00:07:32 +02:00
parent 4200b44e62
commit d510f52aba
4 changed files with 62 additions and 9 deletions

View file

@ -10,6 +10,7 @@
ghq.enable = true;
git.enable = true;
neovim.enable = true;
starship.enable = true;
utils.enable = true;
vifm.enable = true;
zsh.enable = true;

View 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";
};
};
};
};
}

View file

@ -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 {

View file

@ -9,6 +9,7 @@
./cli/ghq/default.nix
./cli/git
./cli/neovim
./cli/starship
./cli/utils
./cli/vifm
./cli/zsh