1
0
mirror of https://github.com/nix-community/home-manager synced 2024-06-01 04:23:34 +02:00

thefuck: add nushell integration

This commit is contained in:
afresquet 2024-04-27 14:52:54 +02:00
parent c1609d584a
commit 7b345894b0
No known key found for this signature in database
3 changed files with 23 additions and 0 deletions

View File

@ -32,6 +32,14 @@ with lib;
Whether to enable Zsh integration.
'';
};
enableNushellIntegration = mkOption {
default = true;
type = types.bool;
description = ''
Whether to enable Nushell integration.
'';
};
};
config = let
@ -66,5 +74,11 @@ with lib;
};
programs.zsh.initExtra = mkIf cfg.enableZshIntegration shEvalCmd;
programs.nushell = mkIf cfg.enableNushellIntegration {
extraConfig = ''
alias fuck = ${cfg.package}/bin/thefuck $"(history | last 1 | get command | get 0)"
'';
};
};
}

View File

@ -6,8 +6,10 @@
thefuck.enableBashIntegration = false;
thefuck.enableFishIntegration = false;
thefuck.enableZshIntegration = false;
thefuck.enableNushellIntegration = false;
bash.enable = true;
zsh.enable = true;
nushell.enable = true;
};
test.stubs.thefuck = { };
@ -16,5 +18,6 @@
assertFileNotRegex home-files/.bashrc '@thefuck@/bin/thefuck'
assertPathNotExists home-files/.config/fish/functions/fuck.fish
assertFileNotRegex home-files/.zshrc '@thefuck@/bin/thefuck'
assertFileNotRegex home-files/.config/nushell/config.nu '@thefuck@/bin/thefuck'
'';
}

View File

@ -6,6 +6,7 @@
bash.enable = true;
fish.enable = true;
zsh.enable = true;
nushell.enable = true;
};
test.stubs.thefuck = { };
@ -33,5 +34,10 @@
assertFileContains \
home-files/.zshrc \
'eval "$(@thefuck@/bin/thefuck '"'"'--alias'"'"')"'
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)"'
'';
}