Skip to content

Commit

Permalink
using ttyd provided in /home/heywoodlh/.nix-profile/bin/ttyd if avail…
Browse files Browse the repository at this point in the history
…able
  • Loading branch information
heywoodlh committed Dec 4, 2024
1 parent 5037d4b commit d69f004
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
12 changes: 2 additions & 10 deletions dev/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,16 +1,8 @@
FROM docker.io/heywoodlh/nix:latest AS ttyd-builder

RUN nix bundle --bundler "github:nixos/bundlers#toDEB" "github:heywoodlh/flakes?dir=ttyd-nerd" -o /ttyd

FROM docker.io/heywoodlh/nix:latest
LABEL MAINTAINER=heywoodlh

COPY --from=ttyd-builder /ttyd /ttyd

RUN apt update && apt install -y curl openssh-server mosh supervisor sudo \
&& dpkg -i /ttyd/*.deb \
&& rm -rf /var/lib/apt/lists/* #\
&& rm -rf /ttyd
RUN apt update && apt install -y ttyd curl openssh-server mosh supervisor sudo \
&& rm -rf /var/lib/apt/lists/*

RUN userdel ubuntu \
&& addgroup --gid 1000 heywoodlh \
Expand Down
3 changes: 3 additions & 0 deletions dev/heywoodlh.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ then
curl -H 'Cache-Control: no-cache' -L https://files.heywoodlh.io/scripts/linux.sh | bash -s -- server \
&& rm -rf /home/heywoodlh/.cache/nix/

# nerd-font ttyd
nix profile install "github:heywoodlh/flakes?dir=ttyd-nerd#ttyd"

## kill ttyd after tmux install
[[ -e /home/heywoodlh/.nix-profile/bin/tmux ]] && sudo pkill -9 ttyd
fi
7 changes: 6 additions & 1 deletion dev/ttyd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,9 @@ fi
COMMAND="/bin/bash"
[[ -e /home/heywoodlh/.nix-profile/bin/tmux ]] && COMMAND="/home/heywoodlh/.nix-profile/bin/tmux"

/bin/ttyd -W -t fontSize=16 -t fontFamily="JetBrains" -p 80 --uid 1000 --gid 1000 -w /home/heywoodlh --writable ${TTYD_ARGS} ${COMMAND}
if [[ -e /home/heywoodlh/.nix-profile/bin/ttyd ]]
then
/home/heywoodlh/.nix-profile/bin/ttyd -W -t fontSize=16 -t fontFamily="JetBrains" -p 80 --uid 1000 --gid 1000 -w /home/heywoodlh --writable ${TTYD_ARGS} ${COMMAND}
else
/usr/bin/ttyd -W -t fontSize=16 -t fontFamily="JetBrains" -p 80 --uid 1000 --gid 1000 -w /home/heywoodlh --writable ${TTYD_ARGS} ${COMMAND}
fi

0 comments on commit d69f004

Please sign in to comment.