blob: a7cc2f5aa7d9cc39e3e80f852ef89a3dac0d9c80 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
|
# Fuzzy finder, CLI fuzzy search tool
{
config,
lib,
pkgs,
...
}:
let
base16Colors = import ../../colors/base16 { inherit config lib pkgs; };
in
{
imports = [ ./assertions.nix ];
options.terminal.fzf = {
enable = lib.mkEnableOption "Enables fzf.";
package = lib.mkOption {
type = lib.types.package;
readOnly = true;
default = config.programs.fzf.package;
description = "The fzf package to use.";
};
};
config =
let
shellIntegration = ''
${if config.terminal.zsh.enable then "eval \"$(fzf --zsh)\"" else "eval \"$(fzf --bash)\""}
'';
in
lib.mkIf config.terminal.fzf.enable {
programs.fzf = {
enable = true;
defaultOptions = [
"--height 100%"
"--layout=reverse"
"--pointer=' '"
"--header=' '"
"--prompt=' '"
"--marker='✓ '"
"--border=none"
"--cycle"
"--no-info"
"--margin='1,2'"
];
colors = with base16Colors.colorsWithHashPrefix; {
fg = base05;
bg = "-1";
hl = base0D;
"fg+" = base07;
"bg+" = "-1";
"hl+" = base0D;
gutter = "-1";
info = base0B;
border = base03;
prompt = base0A;
pointer = base0F;
marker = base0C;
spinner = base0C;
};
};
programs.zsh.initContent = lib.mkIf config.terminal.zsh.enable (lib.mkAfter shellIntegration);
};
}
|