fix: nushell oh my posh prompt config

This commit is contained in:
Rasyidan Akbar F. 2025-10-01 10:54:05 +07:00
commit 305f8706e0
2 changed files with 36 additions and 0 deletions

View file

@ -3,9 +3,32 @@ let
themeName = "capr4n.omp.json";
themeSource = ./oh-my-posh/capr4n.omp.json;
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 {
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 = {
enable = lib.mkDefault true;
enableNushellIntegration = lib.mkDefault true;