Skip to content

Commit

Permalink
feat(terminal): change prompt from starship to oh-my-posh
Browse files Browse the repository at this point in the history
  • Loading branch information
Pyxels committed Jul 17, 2024
1 parent 85a2802 commit 03cae90
Show file tree
Hide file tree
Showing 3 changed files with 87 additions and 110 deletions.
86 changes: 86 additions & 0 deletions home/oh-my-posh.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
{
programs.oh-my-posh = {
enable = true;

settings = {
version = 2;
final_space = true;
disable_notice = true;

blocks = [
{
type = "prompt";
alignment = "left";
newline = true;
segments = [
{
type = "path";
foreground = "blue";
template = "{{ .Path }}";
properties.style = "unique";
}
{
type = "git";
foreground = "p:grey";
background = "transparent";
template = " {{ .HEAD }}{{ if or (.Working.Changed) (.Staging.Changed) }}<yellow>*</>{{ end }}<cyan>{{ if gt .Behind 0 }} ⇣{{ end }}{{ if gt .Ahead 0 }} ⇡{{ end }}</>{{ if gt .StashCount 0 }}  {{ .StashCount }}{{ end }}";
properties = {
branch_icon = "";
commit_icon = "@";
fetch_status = true;
};
}
];
}

{
type = "rprompt";
overflow = "hidden";

segments = [
{
type = "executiontime";
foreground = "yellow";
template = "{{ .FormattedMs }}";

properties. threshold = 1000;
}
];
}

{
type = "prompt";
alignment = "left";
newline = true;

segments = [
{
type = "text";
style = "plain";
foreground_templates = [
"{{if gt .Code 0}}red{{end}}"
"{{if eq .Code 0}}magenta{{end}}"
];
background = "transparent";
template = "❯";
}
];
}
];

transient_prompt = {
foreground_templates = [
"{{if gt .Code 0}}red{{end}}"
"{{if eq .Code 0}}magenta{{end}}"
];
template = "❯ ";
};

secondary_prompt = {
foreground = "magenta";
background = "transparent";
template = "❯❯ ";
};
};
};
}
109 changes: 0 additions & 109 deletions home/starship.nix

This file was deleted.

2 changes: 1 addition & 1 deletion home/terminal.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
./zellij
./zsh.nix
./git.nix
./starship.nix
./oh-my-posh.nix
./run_local_nixpkgs.nix
];

Expand Down

0 comments on commit 03cae90

Please sign in to comment.