Skip to content

Commit

Permalink
fix: add dynamic config directory to tmesh-server
Browse files Browse the repository at this point in the history
  • Loading branch information
simonwjackson committed Apr 11, 2024
1 parent 9a1743d commit 820718b
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
1 change: 1 addition & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
use flake
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
result
.direnv
9 changes: 7 additions & 2 deletions nix/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@ pkgs.resholve.mkDerivation rec {
substituteInPlace $out/bin/choose-session.sh \
--replace "@tmux" "${pkgs.lib.meta.getExe pkgs.tmux}" \
--replace "@jq" "${pkgs.lib.meta.getExe pkgs.jq}"
--replace "@jq" "${pkgs.lib.meta.getExe pkgs.jq}" \
substituteInPlace $out/bin/tmesh \
--replace "mosh " "${pkgs.lib.meta.getExe pkgs.mosh} "
runHook postInstall
'';
Expand All @@ -33,16 +36,17 @@ pkgs.resholve.mkDerivation rec {
inputs =
[
"${placeholder "out"}/bin"
pkgs.fzf
]
++ (with pkgs; [
bash
coreutils
fd
findutils
fzf
gawk
gnused
jq
mosh
nettools
tmux
yq-go
Expand All @@ -62,6 +66,7 @@ pkgs.resholve.mkDerivation rec {
"cannot:${pkgs.fzf}/bin/fzf"
"cannot:${pkgs.tmux}/bin/tmux"
"cannot:${pkgs.yq-go}/bin/yq"
"cannot:${pkgs.mosh}/bin/mosh"
];
};
};
Expand Down
3 changes: 2 additions & 1 deletion src/bin/tmesh-server
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
SCRIPT_DIR="$(dirname "$0")"
TMESH_SERVER_SOCKET=${TMESH_SERVER_SOCKET:-"workspace"}
TMUX_CONFIG=${TMUX_CONFIG:="${SCRIPT_DIR}/../etc/tmesh/tmesh-server.tmux.conf"}
TMESH_CONFIG=${TMESH_CONFIG:="/etc/tmesh/config.json"}

COMMAND="$(yq -e '.local-tmesh-server.command' ./config.yaml 2>/dev/null || echo "${SHELL}")"
COMMAND="$(yq -e -oy '.local-tmesh-server.command' "${TMESH_CONFIG}" 2>/dev/null || echo "${SHELL}")"

tmux \
-L "${TMESH_SERVER_SOCKET}" \
Expand Down

0 comments on commit 820718b

Please sign in to comment.