1
0
Fork 0
mirror of https://github.com/nix-community/home-manager synced 2024-11-10 21:29:48 +01:00

oh-my-posh: fix test under Darwin

This commit is contained in:
Robert Helgesson 2023-12-28 23:07:47 +01:00 committed by Mikilio
parent 0402cca9d8
commit a7c92eece7
No known key found for this signature in database
GPG key ID: 5B2F1A890CF33F3F

View file

@ -1,4 +1,4 @@
{ ... }:
{ pkgs, ... }:
{
programs = {
@ -15,15 +15,25 @@
nushell = { };
};
nmt.script = ''
assertFileExists home-files/.config/nushell/env.nu
nmt.script = let
configFile = if pkgs.stdenv.isDarwin then
"home-files/Library/Application Support/nushell/config.nu"
else
"home-files/.config/nushell/config.nu";
envFile = if pkgs.stdenv.isDarwin then
"home-files/Library/Application Support/nushell/env.nu"
else
"home-files/.config/nushell/env.nu";
in ''
assertFileExists "${envFile}"
assertFileRegex \
home-files/.config/nushell/env.nu \
"${envFile}" \
'/bin/oh-my-posh init nu --config .*--print \| save --force /.*/home-files/\.cache/oh-my-posh/init\.nu'
assertFileExists home-files/.config/nushell/config.nu
assertFileExists "${configFile}"
assertFileRegex \
home-files/.config/nushell/config.nu \
"${configFile}" \
'source /.*/\.cache/oh-my-posh/init\.nu'
'';
}