feat: add support for host-spawn
This commit is contained in:
@@ -9,7 +9,7 @@ FROM quay.io/fedora/fedora:42
|
|||||||
RUN dnf update -y && \
|
RUN dnf update -y && \
|
||||||
dnf copr enable -y atim/lazygit && \
|
dnf copr enable -y atim/lazygit && \
|
||||||
dnf -y install neovim unzip awk jq \
|
dnf -y install neovim unzip awk jq \
|
||||||
bash-completion zoxide fd-find chafa lazygit procps \
|
bash-completion host-spawn zoxide fd-find chafa lazygit procps \
|
||||||
git go npm
|
git go npm
|
||||||
|
|
||||||
# === setup container user ===
|
# === setup container user ===
|
||||||
@@ -26,6 +26,7 @@ RUN mkdir .config .local .cache
|
|||||||
|
|
||||||
# Copy config into container.
|
# Copy config into container.
|
||||||
COPY --chown=user:user config/bashrc .bashrc
|
COPY --chown=user:user config/bashrc .bashrc
|
||||||
|
COPY config/bin /usr/local/bin
|
||||||
|
|
||||||
# === setup container ===
|
# === setup container ===
|
||||||
# Set timezone inside container.
|
# Set timezone inside container.
|
||||||
|
|||||||
@@ -9,10 +9,12 @@ export EDITOR=nvim \
|
|||||||
WAYLAND_DISPLAY=wayland-0 \
|
WAYLAND_DISPLAY=wayland-0 \
|
||||||
XDG_RUNTIME_DIR=/run/user/1000 \
|
XDG_RUNTIME_DIR=/run/user/1000 \
|
||||||
SSH_AUTH_SOCK=/run/user/1000/ssh-auth-sock \
|
SSH_AUTH_SOCK=/run/user/1000/ssh-auth-sock \
|
||||||
|
DBUS_SESSION_BUS_ADDRESS="unix:path=/tmp/bus" \
|
||||||
PS1='\[\e[30;46m\] container | \w \[\e[0;36m\]\[\e[m\] '
|
PS1='\[\e[30;46m\] container | \w \[\e[0;36m\]\[\e[m\] '
|
||||||
|
|
||||||
# === aliases and functions ===
|
# === aliases and functions ===
|
||||||
alias vi=nvim
|
alias vi=nvim
|
||||||
post() { curl -sF "content=<-" "https://paste.plabble.org/$2?lang=$1" && echo; }
|
post() { curl -sF "content=<-" "https://paste.plabble.org/$2?lang=$1" && echo; }
|
||||||
|
|
||||||
eval "$(zoxide init --cmd cd bash)"
|
eval "$(zoxide init --cmd cd bash)"
|
||||||
eval "$(fzf --bash)"
|
eval "$(fzf --bash)"
|
||||||
|
|||||||
2
config/bin/host
Executable file
2
config/bin/host
Executable file
@@ -0,0 +1,2 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
host-spawn -cwd "${PWD/#$HOME/$HOST_HOME}" "$@"
|
||||||
1
config/bin/podman
Symbolic link
1
config/bin/podman
Symbolic link
@@ -0,0 +1 @@
|
|||||||
|
host
|
||||||
1
config/bin/xdg-open
Symbolic link
1
config/bin/xdg-open
Symbolic link
@@ -0,0 +1 @@
|
|||||||
|
host
|
||||||
4
enter.sh
4
enter.sh
@@ -21,6 +21,10 @@ run_args() {
|
|||||||
# Use host networking.
|
# Use host networking.
|
||||||
arg "--net=host"
|
arg "--net=host"
|
||||||
|
|
||||||
|
# Configure options for host-spawn
|
||||||
|
arg "--volume /run/user/1000/bus:/tmp/bus" # Use host dbus.
|
||||||
|
arg "-e HOST_HOME=\"$HOME\"" # Pas in host $HOME path.
|
||||||
|
|
||||||
# Mount the wayland socket. Required to get the system
|
# Mount the wayland socket. Required to get the system
|
||||||
# clipbard (wl-copy) working.
|
# clipbard (wl-copy) working.
|
||||||
[ -e "/run/user/$UID/wayland-0" ] && arg "-v /run/user/$UID/wayland-0:/run/user/1000/wayland-0"
|
[ -e "/run/user/$UID/wayland-0" ] && arg "-v /run/user/$UID/wayland-0:/run/user/1000/wayland-0"
|
||||||
|
|||||||
Reference in New Issue
Block a user