Skip to content

Commit d627460

Browse files
authored
Merge pull request #164 from ErrorNoInternet/fix-zoxide-shell-integrations
programs/zoxide: fix conflicting shell integrations
2 parents e450543 + f72e29d commit d627460

File tree

1 file changed

+14
-21
lines changed

1 file changed

+14
-21
lines changed

modules/collection/programs/zoxide.nix

Lines changed: 14 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -42,26 +42,19 @@ in {
4242

4343
config = mkIf cfg.enable {
4444
packages = mkIf (cfg.package != true) [cfg.package];
45-
files = {
46-
".zshrc" = mkIf (config.rum.programs.zsh.enable && cfg.integrations.zsh.enable) {
47-
text = mkAfter ''eval "$(${getExe cfg.package} init zsh ${toFlags})"'';
48-
};
49-
};
50-
xdg.config.files = {
51-
/*
52-
Needs to be added to the end of the shell configuration files, hence the `mkIf` and `mkAfter`.
53-
https://github.com/ajeetdsouza/zoxide#installation
54-
*/
55-
"fish/config.fish" = mkIf (config.rum.programs.fish.enable && cfg.integrations.fish.enable) {
56-
text = mkAfter "${getExe cfg.package} init fish ${toFlags} | source";
57-
};
58-
"nushell/config.nu" = mkIf (config.rum.programs.nushell.enable && cfg.integrations.nushell.enable) {
59-
text = mkAfter ''
60-
source ${
61-
pkgs.runCommand "zoxide-init-nu" {} ''${getExe cfg.package} init nushell ${toFlags} >> "$out"''
62-
}
63-
'';
64-
};
65-
};
45+
46+
rum.programs.fish.config = mkIf cfg.integrations.fish.enable (
47+
mkAfter "${getExe cfg.package} init fish ${toFlags} | source"
48+
);
49+
rum.programs.zsh.initConfig = mkIf cfg.integrations.zsh.enable (
50+
mkAfter ''eval "$(${getExe cfg.package} init zsh ${toFlags})"''
51+
);
52+
rum.programs.nushell.extraConfig = mkIf cfg.integrations.nushell.enable (
53+
mkAfter ''
54+
source ${
55+
pkgs.runCommand "zoxide-init-nu" {} ''${getExe cfg.package} init nushell ${toFlags} >> "$out"''
56+
}
57+
''
58+
);
6659
};
6760
}

0 commit comments

Comments
 (0)