fzf: add package option

This commit is contained in:
li 2021-01-14 04:25:53 +00:00 committed by Robert Helgesson
parent 4e86d65aee
commit 08fc1586c0
No known key found for this signature in database
GPG key ID: 36BDAA14C2797E89

View file

@ -10,6 +10,13 @@ in {
options.programs.fzf = {
enable = mkEnableOption "fzf - a command-line fuzzy finder";
package = mkOption {
type = types.package;
default = pkgs.fzf;
defaultText = literalExample "pkgs.fzf";
description = "Package providing the <command>fzf</command> tool.";
};
defaultCommand = mkOption {
type = types.nullOr types.str;
default = null;
@ -111,7 +118,7 @@ in {
};
config = mkIf cfg.enable {
home.packages = [ pkgs.fzf ];
home.packages = [ cfg.package ];
home.sessionVariables = mapAttrs (n: v: toString v)
(filterAttrs (n: v: v != [ ] && v != null) {