fix cli tools config

This commit is contained in:
Chris Kruining 2025-03-28 22:07:09 +01:00
parent 555068556f
commit 816b85e06e
Signed by: chris
SSH key fingerprint: SHA256:nG82MUfuVdRVyCKKWqhY+pCrbz9nbX6uzUns4RKa1Pg
9 changed files with 393 additions and 353 deletions

View file

@ -1,34 +1,37 @@
{ config, options, lib, pkgs, user, ... }:
let
inherit (lib.attrsets) optionalAttrs;
inherit (lib.modules) mkIf;
inherit (lib) mkIf mkEnableOption;
defShell = config.modules.${user}.shell.default;
in
{
options.modules.${user}.shell.toolset.fzf = let
inherit (lib.options) mkEnableOption;
in { enable = mkEnableOption "TUI Fuzzy Finder."; };
options.modules.${user}.shell.toolset.fzf = {
enable = mkEnableOption "TUI Fuzzy Finder.";
};
config = mkIf config.modules.${user}.shell.toolset.fzf.enable {
home-manager.users.${user}.programs.fzf = let
defShell = config.modules.${user}.shell.default;
in {
enable = true;
enableBashIntegration = true;
enableZshIntegration = defShell == "zsh";
enableFishIntegration = defShell == "fish";
home-manager.users.${user} = {
packages = with pkgs; [ fzf ];
tmux.enableShellIntegration = true;
tmux.shellIntegrationOptions = ["-d 40%"];
programs.fzf = {
enable = true;
enableBashIntegration = true;
enableZshIntegration = defShell == "zsh";
enableFishIntegration = defShell == "fish";
defaultCommand = "fd --type f";
defaultOptions = ["--height 40%" "--border"];
tmux.enableShellIntegration = true;
tmux.shellIntegrationOptions = ["-d 40%"];
changeDirWidgetCommand = "fd --type d";
changeDirWidgetOptions = ["--preview 'tree -C {} | head -200'"];
defaultCommand = "fd --type f";
defaultOptions = ["--height 40%" "--border"];
fileWidgetCommand = "fd --type f";
fileWidgetOptions = ["--preview 'head {}'"];
historyWidgetOptions = ["--sort" "--exact"];
changeDirWidgetCommand = "fd --type d";
changeDirWidgetOptions = ["--preview 'tree -C {} | head -200'"];
fileWidgetCommand = "fd --type f";
fileWidgetOptions = ["--preview 'head {}'"];
historyWidgetOptions = ["--sort" "--exact"];
};
};
};
}