And I will be launching tmux directly from wezterm. This setup is alright, but I cannot make shell that will be run by tmux dynamic, which is controlled by this line at the end of config in .tmux.conf:
set -g default-shell /run/current-system/sw/bin/zsh
How can I make this dynamic(and get path of another shell, if I pass it into this module as argument)? Can I append string like this to a file(.tmux.conf) from nix?
There are a few ways you could do this, albeit not with symlinks (those are directly symlinked, after all, so you can’t dynamically edit them - they are by definition exactly the same as the ones in your dotfiles).
If you want to append, the easiest way is:
home.file = {
".tmux.conf" = {
text = (builtins.readFile ../../dotfiles/.tmux.conf) + ''
set -g default-shell ${pkgs.zsh}/bin/zsh
'';
};
};
Alternatively you could build the file as a package, and use NixOS - Nixpkgs 21.05 manual, use the string replacement functions from nix directly, or convert your tmux config to home-manager configuration and use their extraArgs.