diff --git a/Containerfile b/Containerfile index 6ba0b1d..9dfe5f2 100644 --- a/Containerfile +++ b/Containerfile @@ -9,7 +9,7 @@ FROM quay.io/fedora/fedora:42 RUN dnf update -y && \ dnf copr enable -y atim/lazygit && \ 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 # === setup container user === @@ -26,6 +26,7 @@ RUN mkdir .config .local .cache # Copy config into container. COPY --chown=user:user config/bashrc .bashrc +COPY config/bin /usr/local/bin # === setup container === # Set timezone inside container. diff --git a/config/bashrc b/config/bashrc index cc8472d..f6ea1a2 100644 --- a/config/bashrc +++ b/config/bashrc @@ -9,10 +9,12 @@ export EDITOR=nvim \ WAYLAND_DISPLAY=wayland-0 \ XDG_RUNTIME_DIR=/run/user/1000 \ 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\] ' # === aliases and functions === alias vi=nvim post() { curl -sF "content=<-" "https://paste.plabble.org/$2?lang=$1" && echo; } + eval "$(zoxide init --cmd cd bash)" eval "$(fzf --bash)" diff --git a/config/bin/host b/config/bin/host new file mode 100755 index 0000000..45cd774 --- /dev/null +++ b/config/bin/host @@ -0,0 +1,2 @@ +#!/bin/sh +host-spawn -cwd "${PWD/#$HOME/$HOST_HOME}" "$@" diff --git a/config/bin/podman b/config/bin/podman new file mode 120000 index 0000000..fe198d7 --- /dev/null +++ b/config/bin/podman @@ -0,0 +1 @@ +host \ No newline at end of file diff --git a/config/bin/xdg-open b/config/bin/xdg-open new file mode 120000 index 0000000..fe198d7 --- /dev/null +++ b/config/bin/xdg-open @@ -0,0 +1 @@ +host \ No newline at end of file diff --git a/enter.sh b/enter.sh index 172ceef..ec51d97 100755 --- a/enter.sh +++ b/enter.sh @@ -21,6 +21,10 @@ run_args() { # Use host networking. 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 # clipbard (wl-copy) working. [ -e "/run/user/$UID/wayland-0" ] && arg "-v /run/user/$UID/wayland-0:/run/user/1000/wayland-0"