mirror of
https://github.com/harivansh-afk/nix.git
synced 2026-04-15 07:04:47 +00:00
fzf
This commit is contained in:
parent
ac7a2c4811
commit
e1550559e3
9 changed files with 132 additions and 68 deletions
|
|
@ -3,6 +3,7 @@
|
|||
./bat.nix
|
||||
./claude.nix
|
||||
./codex.nix
|
||||
./fzf.nix
|
||||
./gcloud.nix
|
||||
./gh.nix
|
||||
./ghostty.nix
|
||||
|
|
|
|||
10
home/fzf.nix
Normal file
10
home/fzf.nix
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
{config, ...}: let
|
||||
theme = import ../lib/theme.nix {inherit config;};
|
||||
in {
|
||||
home.sessionVariables = {
|
||||
FZF_DEFAULT_OPTS_FILE = theme.paths.fzfCurrentFile;
|
||||
};
|
||||
|
||||
xdg.configFile."fzf/themes/cozybox-dark".text = theme.renderFzf "dark";
|
||||
xdg.configFile."fzf/themes/cozybox-light".text = theme.renderFzf "light";
|
||||
}
|
||||
|
|
@ -9,7 +9,7 @@ in {
|
|||
home.packages = builtins.attrValues customScripts.packages;
|
||||
|
||||
home.activation.initializeThemeState = lib.hm.dag.entryAfter ["writeBoundary"] ''
|
||||
mkdir -p "${customScripts.theme.paths.stateDir}" "${customScripts.theme.paths.ghosttyDir}" "${customScripts.theme.paths.tmuxDir}"
|
||||
mkdir -p "${customScripts.theme.paths.stateDir}" "${customScripts.theme.paths.fzfDir}" "${customScripts.theme.paths.ghosttyDir}" "${customScripts.theme.paths.tmuxDir}"
|
||||
|
||||
if [[ -f "${customScripts.theme.paths.stateFile}" ]]; then
|
||||
mode=$(tr -d '[:space:]' < "${customScripts.theme.paths.stateFile}")
|
||||
|
|
@ -20,16 +20,19 @@ in {
|
|||
|
||||
case "$mode" in
|
||||
light)
|
||||
fzf_target="${customScripts.theme.paths.fzfDir}/cozybox-light"
|
||||
ghostty_target="${customScripts.theme.paths.ghosttyDir}/cozybox-light"
|
||||
tmux_target="${customScripts.tmuxConfigs.light}"
|
||||
;;
|
||||
*)
|
||||
printf '%s\n' "${customScripts.theme.defaultMode}" > "${customScripts.theme.paths.stateFile}"
|
||||
fzf_target="${customScripts.theme.paths.fzfDir}/cozybox-dark"
|
||||
ghostty_target="${customScripts.theme.paths.ghosttyDir}/cozybox-dark"
|
||||
tmux_target="${customScripts.tmuxConfigs.dark}"
|
||||
;;
|
||||
esac
|
||||
|
||||
ln -sfn "$fzf_target" "${customScripts.theme.paths.fzfCurrentFile}"
|
||||
ln -sfn "$ghostty_target" "${customScripts.theme.paths.ghosttyCurrentFile}"
|
||||
ln -sfn "$tmux_target" "${customScripts.theme.paths.tmuxCurrentFile}"
|
||||
'';
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue