{ pkgs, lib, theme, ... }: let # Rofi script-mode indexer: exposes every executable user script # (shell, python, whatever) so the launcher finds "everything". rofiScripts = pkgs.writeShellScriptBin "rofi-scripts" (builtins.readFile ./rofi/rofi-scripts.sh); # Inject the shared palette into the rasi theme (see home/theme.nix). # `/. +` turns the generated derivation into a path, which the rofi module # treats as a theme file to link into its data directory. rofiThemeText = pkgs.writeText "volt.rasi" ( lib.replaceStrings [ "@bg0@" "@bg1@" "@fg0@" "@fg1@" "@fg2@" "@volt@" "@voltDim@" "@coral@" "@border0@" ] [ "${theme.colors.bgSecondary}f2" "${theme.colors.glassBg}f2" theme.colors.textSecondary theme.colors.textPrimary theme.colors.textMuted theme.colors.accentVolt "${theme.colors.accentVolt}1a" theme.colors.accentCoral "${theme.colors.textPrimary}14" ] (builtins.readFile ./rofi/volt.rasi) ); in { # Install the generated theme under the rofi theme search path and select # it by name (passing a derivation directly is treated as a rasi attrset). xdg.dataFile."rofi/themes/volt.rasi".source = rofiThemeText; programs.rofi = { enable = true; terminal = "${pkgs.foot}/bin/foot"; cycle = true; theme = "volt"; extraConfig = { # Combi mode searches .desktop apps (drun), binaries (run), # open windows (window) and user scripts (scripts). modes = "combi"; combi-modes = "drun,run,window,scripts:${rofiScripts}/bin/rofi-scripts"; show-icons = false; drun-display-format = "{name} {comment}"; display-combi = "silicon volt >"; matching = "fuzzy"; sort = true; }; }; }