mirror of
https://github.com/nix-community/home-manager
synced 2024-11-11 05:39:44 +01:00
mcfly: add mcfly-fzf integration
This commit is contained in:
parent
3b678fe158
commit
1061543033
1 changed files with 24 additions and 10 deletions
|
@ -5,6 +5,24 @@ let
|
||||||
|
|
||||||
cfg = config.programs.mcfly;
|
cfg = config.programs.mcfly;
|
||||||
|
|
||||||
|
bashIntegration = ''
|
||||||
|
eval "$(${getExe pkgs.mcfly} init bash)"
|
||||||
|
'' + optionalString cfg.fzf.enable ''
|
||||||
|
eval "$(${getExe pkgs.mcfly-fzf} init bash)"
|
||||||
|
'';
|
||||||
|
|
||||||
|
fishIntegration = ''
|
||||||
|
${getExe pkgs.mcfly} init fish | source
|
||||||
|
'' + optionalString cfg.fzf.enable ''
|
||||||
|
${getExe pkgs.mcfly-fzf} init fish | source
|
||||||
|
'';
|
||||||
|
|
||||||
|
zshIntegration = ''
|
||||||
|
eval "$(${getExe pkgs.mcfly} init zsh)"
|
||||||
|
'' + optionalString cfg.fzf.enable ''
|
||||||
|
eval "$(${getExe pkgs.mcfly-fzf} init zsh)"
|
||||||
|
'';
|
||||||
|
|
||||||
in {
|
in {
|
||||||
meta.maintainers = [ ];
|
meta.maintainers = [ ];
|
||||||
|
|
||||||
|
@ -30,6 +48,8 @@ in {
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
fzf.enable = mkEnableOption "McFly fzf integration";
|
||||||
|
|
||||||
enableLightTheme = mkOption {
|
enableLightTheme = mkOption {
|
||||||
default = false;
|
default = false;
|
||||||
type = types.bool;
|
type = types.bool;
|
||||||
|
@ -75,19 +95,13 @@ in {
|
||||||
|
|
||||||
config = mkIf cfg.enable (mkMerge [
|
config = mkIf cfg.enable (mkMerge [
|
||||||
{
|
{
|
||||||
home.packages = [ pkgs.mcfly ];
|
home.packages = [ pkgs.mcfly ] ++ optional cfg.fzf.enable pkgs.mcfly-fzf;
|
||||||
|
|
||||||
programs.bash.initExtra = mkIf cfg.enableBashIntegration ''
|
programs.bash.initExtra = mkIf cfg.enableBashIntegration bashIntegration;
|
||||||
eval "$(${pkgs.mcfly}/bin/mcfly init bash)"
|
|
||||||
'';
|
|
||||||
|
|
||||||
programs.zsh.initExtra = mkIf cfg.enableZshIntegration ''
|
programs.zsh.initExtra = mkIf cfg.enableZshIntegration zshIntegration;
|
||||||
eval "$(${pkgs.mcfly}/bin/mcfly init zsh)"
|
|
||||||
'';
|
|
||||||
|
|
||||||
programs.fish.shellInit = mkIf cfg.enableFishIntegration ''
|
programs.fish.shellInit = mkIf cfg.enableFishIntegration fishIntegration;
|
||||||
${pkgs.mcfly}/bin/mcfly init fish | source
|
|
||||||
'';
|
|
||||||
|
|
||||||
home.sessionVariables.MCFLY_KEY_SCHEME = cfg.keyScheme;
|
home.sessionVariables.MCFLY_KEY_SCHEME = cfg.keyScheme;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue