2023-10-01 16:41:55 +02:00
|
|
|
{ ... }:
|
|
|
|
|
|
|
|
{
|
|
|
|
programs = {
|
|
|
|
thefuck.enable = true;
|
|
|
|
bash.enable = true;
|
2023-11-03 16:33:15 +01:00
|
|
|
fish.enable = true;
|
2023-10-01 16:41:55 +02:00
|
|
|
zsh.enable = true;
|
2024-04-29 09:53:42 +02:00
|
|
|
nushell.enable = true;
|
2023-10-01 16:41:55 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
test.stubs.thefuck = { };
|
|
|
|
|
|
|
|
nmt.script = ''
|
|
|
|
assertFileExists home-files/.bashrc
|
|
|
|
assertFileContains \
|
|
|
|
home-files/.bashrc \
|
2024-09-08 09:55:05 +02:00
|
|
|
'eval "$(@thefuck@/bin/thefuck --alias)"'
|
2023-10-01 16:41:55 +02:00
|
|
|
|
2023-11-03 16:33:15 +01:00
|
|
|
assertFileExists home-files/.config/fish/functions/fuck.fish
|
|
|
|
assertFileContains \
|
|
|
|
home-files/.config/fish/functions/fuck.fish \
|
|
|
|
'function fuck --description="Correct your previous console command"
|
|
|
|
set -l fucked_up_command $history[1]
|
|
|
|
env TF_SHELL=fish TF_ALIAS=fuck PYTHONIOENCODING=utf-8 @thefuck@/bin/thefuck $fucked_up_command THEFUCK_ARGUMENT_PLACEHOLDER $argv | read -l unfucked_command
|
|
|
|
if [ "$unfucked_command" != "" ]
|
|
|
|
eval $unfucked_command
|
|
|
|
builtin history delete --exact --case-sensitive -- $fucked_up_command
|
|
|
|
builtin history merge
|
|
|
|
end
|
|
|
|
end'
|
|
|
|
|
2023-10-01 16:41:55 +02:00
|
|
|
assertFileExists home-files/.zshrc
|
|
|
|
assertFileContains \
|
|
|
|
home-files/.zshrc \
|
2024-09-08 09:55:05 +02:00
|
|
|
'eval "$(@thefuck@/bin/thefuck --alias)"'
|
2024-04-29 09:53:42 +02:00
|
|
|
|
|
|
|
assertFileExists home-files/.config/nushell/config.nu
|
|
|
|
assertFileContains \
|
|
|
|
home-files/.config/nushell/config.nu \
|
|
|
|
'alias fuck = @thefuck@/bin/thefuck $"(history | last 1 | get command | get 0)"'
|
2023-10-01 16:41:55 +02:00
|
|
|
'';
|
|
|
|
}
|