mirror of
https://github.com/nix-community/home-manager.git
synced 2026-01-12 01:59:37 +08:00
oh-my-posh: fix nushell with v26.0.0 (#7342)
This commit is contained in:
@@ -82,10 +82,15 @@ in
|
||||
|
||||
programs.nushell = mkIf cfg.enableNushellIntegration {
|
||||
extraConfig = ''
|
||||
source ${
|
||||
pkgs.runCommand "oh-my-posh-nushell-config.nu" { } ''
|
||||
${lib.getExe cfg.package} init nu ${configArgument} --print >> "$out"
|
||||
''
|
||||
${
|
||||
if lib.versionAtLeast (lib.versions.major cfg.package.version) "26" then
|
||||
"${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"
|
||||
''
|
||||
}''
|
||||
}
|
||||
'';
|
||||
};
|
||||
|
||||
@@ -28,8 +28,18 @@
|
||||
in
|
||||
''
|
||||
assertFileExists "${configFile}"
|
||||
assertFileRegex \
|
||||
"${configFile}" \
|
||||
'source /nix/store/[^/]*-oh-my-posh-nushell-config.nu'
|
||||
${
|
||||
if (lib.versionAtLeast (lib.versions.major config.programs.oh-my-posh.package.version) "26") then
|
||||
''
|
||||
assertFileContains \
|
||||
"${configFile}" \
|
||||
"/bin/oh-my-posh init nu --config"''
|
||||
else
|
||||
|
||||
''
|
||||
assertFileRegex \
|
||||
"${configFile}" \
|
||||
"source /nix/store/[^/]*-oh-my-posh-nushell-config.nu"''
|
||||
}
|
||||
'';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user