1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2025-12-16 14:01:08 +01:00

oh-my-posh: fix nushell with v26.0.0 (#7342)

This commit is contained in:
jaredmontoya 2025-06-30 00:34:38 +02:00 committed by GitHub
parent 76d0c31fce
commit 2b3bb17e87
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 22 additions and 7 deletions

View file

@ -82,10 +82,15 @@ in
programs.nushell = mkIf cfg.enableNushellIntegration { programs.nushell = mkIf cfg.enableNushellIntegration {
extraConfig = '' extraConfig = ''
source ${ ${
pkgs.runCommand "oh-my-posh-nushell-config.nu" { } '' if lib.versionAtLeast (lib.versions.major cfg.package.version) "26" then
${lib.getExe cfg.package} init nu ${configArgument} --print >> "$out" "${lib.getExe cfg.package} init nu ${configArgument}"
'' else
''source ${
pkgs.runCommand "oh-my-posh-nushell-config.nu" { } ''
${lib.getExe cfg.package} init nu ${configArgument} --print >> "$out"
''
}''
} }
''; '';
}; };

View file

@ -28,8 +28,18 @@
in in
'' ''
assertFileExists "${configFile}" assertFileExists "${configFile}"
assertFileRegex \ ${
"${configFile}" \ if (lib.versionAtLeast (lib.versions.major config.programs.oh-my-posh.package.version) "26") then
'source /nix/store/[^/]*-oh-my-posh-nushell-config.nu' ''
assertFileContains \
"${configFile}" \
"/bin/oh-my-posh init nu --config"''
else
''
assertFileRegex \
"${configFile}" \
"source /nix/store/[^/]*-oh-my-posh-nushell-config.nu"''
}
''; '';
} }