fzf: add nushell integration

This commit is contained in:
leiserfg 2026-06-19 11:44:39 +02:00 committed by Austin Horstman
parent af11a877f2
commit cb6bcc43e7

View file

@ -188,11 +188,19 @@ in
enableFishIntegration = lib.hm.shell.mkFishIntegrationOption { inherit config; };
enableZshIntegration = lib.hm.shell.mkZshIntegrationOption { inherit config; };
enableNushellIntegration = lib.hm.shell.mkNushellIntegrationOption { inherit config; };
};
config = mkIf cfg.enable {
home.packages = [ cfg.package ];
assertions = [
{
assertion = cfg.enableNushellIntegration -> lib.versionAtLeast cfg.package.version "0.73.0";
message = "fzf package version must be 0.73.0 or greater for nushell integration";
}
];
home.packages = [ cfg.package ];
home.sessionVariables = lib.mapAttrs (_n: toString) (
lib.filterAttrs (_n: v: v != [ ] && v != null) {
FZF_ALT_C_COMMAND = cfg.changeDirWidgetCommand;
@ -221,5 +229,16 @@ in
programs.zsh.initContent = mkIf cfg.enableZshIntegration (mkOrder 910 zshIntegration);
programs.fish.interactiveShellInit = mkIf cfg.enableFishIntegration (mkOrder 200 fishIntegration);
programs.nushell = lib.mkIf cfg.enableNushellIntegration {
extraConfig = ''
source ${
pkgs.runCommand "nushell-fzf-integration.nu" { } ''
${lib.getExe cfg.package} --nushell > $out
''
}
'';
};
};
}