Static path in configuration files Ex .tmux.conf

I am using home-manager and deploy .tmux.conf.
Only problem the powerline path is hardcoded in .tmux.conf

source /nix/store/2cw1iwbf804hm0b4hh2p0wqz3jjrwadd-python3.7-powerline-2.7/share/tmux/powerline.conf

set-option -g default-shell "/run/current-system/sw/bin/fish"
set -g default-terminal "screen-256color"
set -as terminal-overrides ",*:Tc"

Current issue every time new version of powerline is deployed hash changes and need manually to adjust to a new path. Is any way to add a relative path in configuration files?

If .tmux.conf is in the nixstore and powerline is in the nixstore I’m not sure if a relative path would help. The relative path would still need the hash. The most you could do is remove /nix/store from the path but that wouldn’t solve your problem.

home-manager should be able to build this path for you. Something like:

file.".tmux.conf".text = ''
  source ${pkgs.powerline}/share/tmux/powerline.conf

I didn’t check the package name but hopefully you get the idea


@alexarice Thx this fixed the problem

1 Like