-
Notifications
You must be signed in to change notification settings - Fork 9
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
base: main
Are you sure you want to change the base?
Conversation
Thank you for the contrib, would be awesome if you could write tests for both of those cases! |
Sure, I can try. |
LGTM, please also add a test for fish integration here |
cfg = config.rum.programs.zoxide; | ||
cfgFlags = concatStringsSep " " cfg.flags; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cfg = config.rum.programs.zoxide; | |
cfgFlags = concatStringsSep " " cfg.flags; | |
toFlags = concatStringsSep " " cfg.flags; | |
cfg = config.rum.programs.zoxide; |
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. | ||
''; | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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"; |
There was a problem hiding this comment.
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 🤦🏻♂️
".config/fish/config.fish".text = mkIf (config.rum.programs.fish.enable && cfg.integrations.fish.enable) ( | ||
mkAfter "${getExe cfg.package} init fish ${toFlags} | source" | ||
); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
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.