Add fzf module (#84)

This commit is contained in:
Jules Amonith 2023-04-19 03:55:33 -04:00 committed by GitHub
parent 5925e3da17
commit 7e70eedc49
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

29
modules/fzf/hm.nix Normal file
View file

@ -0,0 +1,29 @@
{ pkgs, config, lib, ... }:
let
mkFzfKeyValue = lib.generators.mkKeyValueDefault { } ":";
colorConfig = with config.lib.stylix.colors.withHashtag;
lib.concatStringsSep "," (lib.mapAttrsToList mkFzfKeyValue {
"bg" = base00;
"bg+" = base01;
"fg" = base04;
"fg+" = base06;
"header" = base0D;
"hl" = base0D;
"hl+" = base0D;
"info" = base0A;
"marker" = base0C;
"pointer" = base0C;
"prompt" = base0A;
"spinner" = base0C;
});
in
{
options.stylix.targets.fzf = {
enable = config.lib.stylix.mkEnableTarget "Fzf" config.programs.fzf.enable;
};
config = lib.mkIf config.stylix.targets.fzf.enable {
programs.fzf.defaultOptions = lib.mkAfter [ "--color=${colorConfig}" ];
};
}