{
  programs.fzf = {
    enable = true;
    defaultCommand = "fd --type f";
    defaultOptions = [
      "--height 40%"
      "--border"
    ];
    fileWidgetCommand = "fd --type f";
    fileWidgetOptions = [ "--preview 'head {}'" ];
    changeDirWidgetCommand = "fd --type d";
    changeDirWidgetOptions = [ "--preview 'tree -C {} | head -200'" ];
    historyWidgetOptions = [
      "--sort"
      "--exact"
    ];
    colors = {
      bg = "#1e1e1e";
    };
    tmux = {
      enableShellIntegration = true;
      shellIntegrationOptions = [ "-d 40%" ];
    };
  };

  nmt.script = ''
    # Test default options
    assertFileRegex home-path/etc/profile.d/hm-session-vars.sh \
      'FZF_DEFAULT_COMMAND="fd --type f"'
    assertFileRegex home-path/etc/profile.d/hm-session-vars.sh \
      'FZF_DEFAULT_OPTS="--height 40% --border --color'

    # Test file widget
    assertFileRegex home-path/etc/profile.d/hm-session-vars.sh \
      'FZF_CTRL_T_COMMAND="fd --type f"'
    assertFileRegex home-path/etc/profile.d/hm-session-vars.sh \
      'FZF_CTRL_T_OPTS="--preview'

    # Test change dir widget
    assertFileRegex home-path/etc/profile.d/hm-session-vars.sh \
      'FZF_ALT_C_COMMAND="fd --type d"'
    assertFileRegex home-path/etc/profile.d/hm-session-vars.sh \
      'FZF_ALT_C_OPTS="--preview'

    # Test history widget
    assertFileRegex home-path/etc/profile.d/hm-session-vars.sh \
      'FZF_CTRL_R_OPTS="--sort --exact"'

    # Test tmux
    assertFileRegex home-path/etc/profile.d/hm-session-vars.sh \
      'FZF_TMUX="1"'
    assertFileRegex home-path/etc/profile.d/hm-session-vars.sh \
      'FZF_TMUX_OPTS="-d 40%"'

    # Test colors are exported
    assertFileRegex home-path/etc/profile.d/hm-session-vars.sh \
      'FZF_DEFAULT_OPTS=.*--color'
  '';
}
