mirror of
https://github.com/nix-community/home-manager.git
synced 2026-01-12 01:59:37 +08:00
Didn't fail even with incorrect assertion. Multi line string for assertFileContains didn't properly work. Don't want to manage an entire zsh config file in assertFileContent so just multi step asserting the generated file. Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
19 lines
633 B
Nix
19 lines
633 B
Nix
{
|
|
programs.bash.enable = true;
|
|
|
|
programs.yazi = {
|
|
enable = true;
|
|
enableBashIntegration = true;
|
|
};
|
|
|
|
nmt.script = ''
|
|
assertFileExists home-files/.bashrc
|
|
assertFileContains home-files/.bashrc 'function yy() {'
|
|
assertFileContains home-files/.bashrc 'local tmp="$(mktemp -t "yazi-cwd.XXXXX")"'
|
|
assertFileContains home-files/.bashrc 'yazi "$@" --cwd-file="$tmp"'
|
|
assertFileContains home-files/.bashrc 'if cwd="$(<"$tmp")" && [ -n "$cwd" ] && [ "$cwd" != "$PWD" ]; then'
|
|
assertFileContains home-files/.bashrc 'builtin cd -- "$cwd"'
|
|
assertFileContains home-files/.bashrc 'rm -f -- "$tmp"'
|
|
'';
|
|
}
|