fix: nushell oh my posh prompt config
This commit is contained in:
parent
29b47dcb0e
commit
305f8706e0
2 changed files with 36 additions and 0 deletions
|
|
@ -3,9 +3,32 @@ let
|
||||||
themeName = "capr4n.omp.json";
|
themeName = "capr4n.omp.json";
|
||||||
themeSource = ./oh-my-posh/capr4n.omp.json;
|
themeSource = ./oh-my-posh/capr4n.omp.json;
|
||||||
themeConfigPath = "${config.xdg.configHome}/oh-my-posh/${themeName}";
|
themeConfigPath = "${config.xdg.configHome}/oh-my-posh/${themeName}";
|
||||||
|
profileBin = "${config.home.profileDirectory}/bin";
|
||||||
|
systemBin = "/run/current-system/sw/bin";
|
||||||
|
defaultBin = "/nix/var/nix/profiles/default/bin";
|
||||||
in {
|
in {
|
||||||
programs.nushell.enable = lib.mkDefault true;
|
programs.nushell.enable = lib.mkDefault true;
|
||||||
|
|
||||||
|
programs.nushell.envFile.text = ''
|
||||||
|
let nix_paths = [
|
||||||
|
"${profileBin}"
|
||||||
|
"${systemBin}"
|
||||||
|
"${defaultBin}"
|
||||||
|
]
|
||||||
|
|
||||||
|
if ($env.PATH? == null) {
|
||||||
|
$env.PATH = $nix_paths
|
||||||
|
} else {
|
||||||
|
for path in $nix_paths {
|
||||||
|
if not ($env.PATH | any {|it| $it == $path}) {
|
||||||
|
$env.PATH = ($env.PATH | append $path)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$env.NIX_PROFILES = "/run/current-system/sw ${config.home.profileDirectory}"
|
||||||
|
'';
|
||||||
|
|
||||||
programs.oh-my-posh = {
|
programs.oh-my-posh = {
|
||||||
enable = lib.mkDefault true;
|
enable = lib.mkDefault true;
|
||||||
enableNushellIntegration = lib.mkDefault true;
|
enableNushellIntegration = lib.mkDefault true;
|
||||||
|
|
|
||||||
|
|
@ -62,6 +62,19 @@
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"type": "prompt"
|
"type": "prompt"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"alignment": "left",
|
||||||
|
"newline": true,
|
||||||
|
"segments": [
|
||||||
|
{
|
||||||
|
"foreground": "#61AFEF",
|
||||||
|
"style": "plain",
|
||||||
|
"template": "❯ ",
|
||||||
|
"type": "text"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"type": "prompt"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"console_title_template": "{{if .Root}} \u26a1 {{end}}{{.UserName}} \u2794 📁{{.Folder}}",
|
"console_title_template": "{{if .Root}} \u26a1 {{end}}{{.UserName}} \u2794 📁{{.Folder}}",
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue