Skip to content

Commit

Permalink
fzf: use Home Manager color options (#454)
Browse files Browse the repository at this point in the history
home-manager provides a programs.fzf.colors option to provide colors.
This module basically reimplemented the logic Home Manager has as well.
  • Loading branch information
antonmosich authored Jun 27, 2024
1 parent 7cdbd12 commit 1ff9d37
Showing 1 changed file with 7 additions and 13 deletions.
20 changes: 7 additions & 13 deletions modules/fzf/hm.nix
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
{ config, lib, ... }:
let
mkFzfKeyValue = lib.generators.mkKeyValueDefault { } ":";
{
options.stylix.targets.fzf = {
enable = config.lib.stylix.mkEnableTarget "Fzf" true;
};

colorConfig = with config.lib.stylix.colors.withHashtag;
lib.concatStringsSep "," (lib.mapAttrsToList mkFzfKeyValue {
config = lib.mkIf (config.stylix.enable && config.stylix.targets.fzf.enable) {
programs.fzf.colors = with config.lib.stylix.colors.withHashtag; {
"bg" = base00;
"bg+" = base01;
"fg" = base04;
Expand All @@ -16,14 +18,6 @@ let
"pointer" = base0C;
"prompt" = base0A;
"spinner" = base0C;
});
in
{
options.stylix.targets.fzf = {
enable = config.lib.stylix.mkEnableTarget "Fzf" true;
};

config = lib.mkIf (config.stylix.enable && config.stylix.targets.fzf.enable) {
programs.fzf.defaultOptions = lib.mkAfter [ "--color=${colorConfig}" ];
};
};
}

0 comments on commit 1ff9d37

Please sign in to comment.