Files
nix/users/blake/dots/desktop/tofi/default.nix

53 lines
1.3 KiB
Nix

{
pkgs,
lib,
config,
...
}: let
program = "tofi";
cfg = config.dots.${program};
#sec = sops.secrets;
in {
options.dots.${program} = {
enable = lib.mkEnableOption "enables ${program}";
};
config = lib.mkIf cfg.enable {
programs.${program} = {
enable = true;
settings = {
# anchor = "top";
# width = "100%";
# height = 25;
# horizontal = true;
font-size = lib.mkDefault 12;
prompt-text = " select: ";
# outline-width = 0;
# border-width = 0;
# corner-radius = 9;
background-color = lib.mkDefault "#2f1730";
selection-color = lib.mkDefault "#ffffff";
text-color = lib.mkDefault "#888888";
# min-input-width = 120;
# result-spacing = 15;
# padding-top = 0;
# padding-bottom = 0;
# padding-left = 0;
# padding-right = 0;
};
};
# this clears the tofi-drun cache on every rebuild
# if this isn't present then new programs will not
# appear in the list when using as app launcher
home.activation = {
# https://github.com/philj56/tofi/issues/115#issuecomment-1701748297
regenerateTofiCache = lib.hm.dag.entryAfter [ "writeBoundary" ] ''
tofi_cache=${config.xdg.cacheHome}/tofi-drun
[[ -f "$tofi_cache" ]] && rm "$tofi_cache"
'';
};
};
}