Files
home-manager/tests/modules/programs/tere/integrations.nix
Nicolai Weitkemper (with AI) 59203fe214 tere: add module
Adds programs.tere, which installs tere and sets up the shell wrapper
it needs to change the current directory on exit, for Bash, Zsh, Fish
and Nushell.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-12-02 10:01:21 -06:00

43 lines
1.2 KiB
Nix

{ config, pkgs, ... }:
{
programs.bash.enable = true;
programs.zsh.enable = true;
programs.fish.enable = true;
programs.nushell.enable = true;
programs.tere = {
enable = true;
package = null;
enableBashIntegration = true;
enableZshIntegration = false;
enableFishIntegration = true;
enableNushellIntegration = true;
};
nmt.script =
let
nushellConfig =
if pkgs.stdenv.hostPlatform.isDarwin && !config.xdg.enable then
"home-files/Library/Application Support/nushell/config.nu"
else
"home-files/.config/nushell/config.nu";
in
''
# A null package must not install tere, but the wrappers still work.
assertPathNotExists home-path/bin/tere
assertFileContains home-files/.bashrc 'tere() {'
assertFileExists home-files/.zshrc
assertFileNotRegex home-files/.zshrc 'tere\(\)'
assertFileContent home-files/.config/fish/functions/tere.fish \
${./fish-integration-expected.fish}
assertFileContains '${nushellConfig}' \
'def --wrapped --env tere [...args] {'
assertFileContains '${nushellConfig}' 'let result = ( ^tere ...$args )'
'';
}