Skip to content

programs/zoxide: init module #72

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Conversation

GetPsyched
Copy link
Contributor

@GetPsyched GetPsyched commented May 20, 2025

I wasn't able to test this since I neither use zsh, nor fish and I'm too lazy to set them up right now. It evals, FWIW; please test.

@nydragon
Copy link
Contributor

Thank you for the contrib, would be awesome if you could write tests for both of those cases!

@GetPsyched
Copy link
Contributor Author

Sure, I can try.

nezia1
nezia1 previously approved these changes May 24, 2025
@nezia1
Copy link
Collaborator

nezia1 commented May 24, 2025

LGTM, please also add a test for fish integration here

Comment on lines 13 to 14
cfg = config.rum.programs.zoxide;
cfgFlags = concatStringsSep " " cfg.flags;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
cfg = config.rum.programs.zoxide;
cfgFlags = concatStringsSep " " cfg.flags;
toFlags = concatStringsSep " " cfg.flags;
cfg = config.rum.programs.zoxide;

Comment on lines 36 to 51
fish.enable = mkOption {
type = bool;
default = false;
example = true;
description = ''
Whether to enable zoxide integration with fish.
'';
};
zsh.enable = mkOption {
type = bool;
default = false;
example = true;
description = ''
Whether to enable zoxide integration with zsh.
'';
};
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
fish.enable = mkOption {
type = bool;
default = false;
example = true;
description = ''
Whether to enable zoxide integration with fish.
'';
};
zsh.enable = mkOption {
type = bool;
default = false;
example = true;
description = ''
Whether to enable zoxide integration with zsh.
'';
};
fish.enable = mkEnableOption "zoxide integration with fish";
zsh.enable = mkEnableOption "zoxide integration with zsh";

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did I not think of that 🤦🏻‍♂️

Comment on lines +49 to +51
".config/fish/config.fish".text = mkIf (config.rum.programs.fish.enable && cfg.integrations.fish.enable) (
mkAfter "${getExe cfg.package} init fish ${toFlags} | source"
);
Copy link
Contributor

@nydragon nydragon May 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it might be preferable to create a file in fish/conf.d, as opposed to this, since here we do not have control over the entire file ourselves. (user supplied string).

Maybe have a dedicated file where all integrations are set up?

But just throwing that thought out tbere, no need to change anything.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I'm not sure about how fish config works TBH. I'll look it up this evening and see what can we better here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants