mirror of
https://github.com/nix-community/home-manager.git
synced 2026-12-06 04:40:17 +00:00
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>
28 lines
641 B
Nix
28 lines
641 B
Nix
{ config, ... }:
|
|
|
|
{
|
|
programs.bash.enable = true;
|
|
|
|
programs.tere = {
|
|
enable = true;
|
|
package = config.lib.test.mkStubPackage {
|
|
name = "tere";
|
|
buildScript = ''
|
|
mkdir -p $out/bin
|
|
touch $out/bin/tere
|
|
chmod +x $out/bin/tere
|
|
'';
|
|
};
|
|
enableBashIntegration = true;
|
|
};
|
|
|
|
nmt.script = ''
|
|
assertFileExists home-path/bin/tere
|
|
|
|
assertFileExists home-files/.bashrc
|
|
assertFileContains home-files/.bashrc 'tere() {'
|
|
assertFileContains home-files/.bashrc 'local result=$(command tere "$@")'
|
|
assertFileContains home-files/.bashrc '[ -n "$result" ] && cd -- "$result"'
|
|
'';
|
|
}
|