Migrate to ohmyposh prompt
This commit is contained in:
parent
1a50d85036
commit
1fc8b9290d
6 changed files with 127 additions and 51 deletions
6
flake.lock
generated
6
flake.lock
generated
|
|
@ -357,11 +357,11 @@
|
|||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1751986323,
|
||||
"narHash": "sha256-EuYWd8FMsqAiAtrAB34LBDe8wgixhMtx1O75fprygX0=",
|
||||
"lastModified": 1754263839,
|
||||
"narHash": "sha256-ck7lILfCNuunsLvExPI4Pw9OOCJksxXwozum24W8b+8=",
|
||||
"owner": "nix-community",
|
||||
"repo": "home-manager",
|
||||
"rev": "5751fa774fa61837f35efb82f3b6e105d4c63ced",
|
||||
"rev": "1d7abbd5454db97e0af51416f4960b3fb64a4773",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
|
|
|||
|
|
@ -47,6 +47,7 @@
|
|||
};
|
||||
|
||||
inputs = {
|
||||
# nixpkgs.url = "git+file:///home/christopher/code/opensource/nixpkgs";
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||
|
||||
# Opinionated flake library for better organization without much boilerplate
|
||||
|
|
@ -60,6 +61,7 @@
|
|||
darwin.inputs.nixpkgs.follows = "nixpkgs";
|
||||
|
||||
home-manager = {
|
||||
# url = "git+file:///home/christopher/code/opensource/home-manager";
|
||||
url = "github:nix-community/home-manager";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ in {
|
|||
imports = [
|
||||
./programs
|
||||
./shell/aliases.nix
|
||||
./shell/prompt.nix
|
||||
./shell/nu
|
||||
./shell/zsh
|
||||
];
|
||||
|
|
|
|||
|
|
@ -0,0 +1,121 @@
|
|||
{...}: let
|
||||
unicode = code: builtins.fromJSON ''"${code}" '';
|
||||
in {
|
||||
programs.oh-my-posh = {
|
||||
enable = true;
|
||||
enableNushellIntegration = true;
|
||||
enableZshIntegration = true;
|
||||
|
||||
# Original settings taken from `catppuccin_frappe`, and adjusted to my
|
||||
# likings and usage.
|
||||
settings = {
|
||||
"$schema" = "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json";
|
||||
version = 3;
|
||||
final_space = true;
|
||||
|
||||
palette = {
|
||||
os = "#acb0be";
|
||||
closer = "p:blue";
|
||||
pink = "#f4b8e4";
|
||||
lavender = "#babbf1";
|
||||
blue = "#8caaee";
|
||||
red = "#e78284";
|
||||
surface = "#414559";
|
||||
};
|
||||
|
||||
blocks = [
|
||||
{
|
||||
alignment = "left";
|
||||
type = "prompt";
|
||||
newline = true;
|
||||
segments = [
|
||||
{
|
||||
foreground = "p:os";
|
||||
style = "plain";
|
||||
template = "{{ .Icon }} ";
|
||||
type = "os";
|
||||
}
|
||||
{
|
||||
foreground = "p:pink";
|
||||
style = "plain";
|
||||
template = "{{ .Path }} ";
|
||||
type = "path";
|
||||
properties = {
|
||||
home_icon = "~";
|
||||
style = "full";
|
||||
mapped_locations = {
|
||||
"~/code/hausgold/env/projects" = "hg-env";
|
||||
"~/code/hausgold" = "hg";
|
||||
"~/code/opensource" = "oss";
|
||||
"~/code/own" = "own";
|
||||
};
|
||||
};
|
||||
}
|
||||
{
|
||||
foreground = "p:blue";
|
||||
style = "plain";
|
||||
template = "{{ .UserName }}@{{ .HostName }} ";
|
||||
type = "session";
|
||||
}
|
||||
{
|
||||
foreground = "p:lavender";
|
||||
template = "{{ .HEAD }} ";
|
||||
style = "plain";
|
||||
type = "git";
|
||||
properties = {
|
||||
branch_icon = unicode "\\ue725 ";
|
||||
cherry_pick_icon = unicode "\\ue29b ";
|
||||
commit_icon = unicode "\\uf417 ";
|
||||
merge_icon = unicode "\\ue727 ";
|
||||
no_commits_icon = unicode "\\uef0c3 ";
|
||||
rebase_icon = unicode "\\ue728 ";
|
||||
revert_icon = unicode "\\uf0e2 ";
|
||||
tag_icon = unicode "\\uf412 ";
|
||||
fetch_status = false;
|
||||
fetch_upstream_icon = false;
|
||||
};
|
||||
}
|
||||
];
|
||||
}
|
||||
{
|
||||
alignment = "right";
|
||||
type = "prompt";
|
||||
segments = [
|
||||
{
|
||||
foreground = "p:red";
|
||||
background = "p:surface";
|
||||
style = "plain";
|
||||
template = unicode "{{ if .Error }}\\uf06d {{ .String }}{{ end }}";
|
||||
type = "status";
|
||||
properties = {
|
||||
always_enabled = true;
|
||||
};
|
||||
}
|
||||
{
|
||||
foreground = "p:pink";
|
||||
style = "plain";
|
||||
template = " {{ .FormattedMs }}";
|
||||
type = "executiontime";
|
||||
properties = {
|
||||
style = "austin";
|
||||
};
|
||||
}
|
||||
];
|
||||
}
|
||||
{
|
||||
alignment = "left";
|
||||
type = "prompt";
|
||||
newline = true;
|
||||
segments = [
|
||||
{
|
||||
foreground = "p:closer";
|
||||
template = "#";
|
||||
style = "plain";
|
||||
type = "text";
|
||||
}
|
||||
];
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
@ -5,14 +5,12 @@
|
|||
}: {
|
||||
imports = [
|
||||
./antigen.nix
|
||||
./prompt.nix
|
||||
];
|
||||
|
||||
programs.zoxide.enableZshIntegration = true;
|
||||
|
||||
programs.zsh = {
|
||||
enable = true;
|
||||
dotDir = ".config/zsh";
|
||||
oh-my-zsh.enable = true;
|
||||
|
||||
shellAliases = config.home.shellAliases;
|
||||
|
|
|
|||
|
|
@ -1,46 +0,0 @@
|
|||
{
|
||||
programs.starship.enable = true;
|
||||
|
||||
# (https://starship.rs/guide/)
|
||||
# Define a Pure-ish prompt
|
||||
programs.starship.settings = {
|
||||
format = ''
|
||||
$username$hostname$directory$git_branch$git_state$git_status$cmd_duration$line_break$character
|
||||
'';
|
||||
|
||||
directory.style = "blue";
|
||||
|
||||
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";
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Reference in a new issue