diff --git a/container/Containerfile b/container/Containerfile index 5d5a7ff..661b53c 100644 --- a/container/Containerfile +++ b/container/Containerfile @@ -4,8 +4,10 @@ FROM quay.io/fedora/fedora:44 RUN --mount=type=cache,id=dnf-cache,target=/var/cache/libdnf5 \ dnf update -y && \ dnf -y --setopt=keepcache=1 --setopt=install_weak_deps=False install \ - bash-completion git-core curl awk jq rg zip unzip which \ - host-spawn wl-copy gcc helix helix-themes rsync python3 python3-pip dotnet-sdk-10.0 openssl-devel + bash-completion git-core curl awk jq rg zip unzip which ncurses \ + host-spawn wl-copy gcc helix helix-themes rsync python3 python3-pip dotnet-sdk-10.0 openssl-devel \ + alsa-lib-devel \ # Neginoth-project + # === setup user === RUN useradd -ms /bin/bash user && \ @@ -45,7 +47,8 @@ RUN export RUSTUP_HOME=/usr/local/rust && \ ln -sf /usr/local/rust/bin/rustfmt /usr/local/bin/rustfmt && \ ln -sf /usr/local/rust/bin/clippy /usr/local/bin/clippy && \ ln -sf /usr/local/rust/bin/rust-analyzer /usr/local/bin/rust-analyzer && \ - rustup component add rustfmt clippy rust-analyzer && \ + rustup component add rustfmt clippy rust-analyzer rust-src && \ + rustup target add wasm32-unknown-unknown && \ curl https://drager.github.io/wasm-pack/installer/init.sh -sSf | sh # cargo install cargo-generate && \ # cargo install cargo-expand @@ -88,6 +91,13 @@ RUN --mount=type=cache,id=dnf-cache,target=/var/cache/libdnf5 \ # === install language servers, tools === RUN deno i -g -f -A --root /usr/local/bin npm:npm npm:bash-language-server npm:vscode-langservers-extracted npm:dockerfile-language-server-nodejs \ npm:typescript npm:typescript-language-server + +RUN mkdir -p /usr/local/bin/python-bins/code-review-graph && \ + pip install code-review-graph --target /usr/local/bin/python-bins/code-review-graph && \ + ln -sf /usr/local/bin/python-bins/code-review-graph/bin/code-review-graph /usr/local/bin/code-review-graph + +# Ownership +RUN chown -R user:user /usr/local/rust USER user WORKDIR /home/user @@ -100,7 +110,7 @@ COPY --chown=user:user config/helix/ .config/helix/ # === Cleanup build dependencies === USER root RUN dnf remove -y openssl-devel && dnf clean all && \ - rm -rf /tmp/* && rm -rf /root/* + rm -rf /tmp/* && rm -rf /root/* && pip cache purge USER user diff --git a/container/config/bashrc b/container/config/bashrc index 36cd0f3..6782f62 100644 --- a/container/config/bashrc +++ b/container/config/bashrc @@ -22,4 +22,4 @@ alias ga="git add -A" alias gf="git fetch" alias gp="git pull" alias gpp="git push" -alias gs="git status" \ No newline at end of file +alias gs="git status" diff --git a/devc.sh b/devc.sh index 9ef7ac4..856d9ef 100755 --- a/devc.sh +++ b/devc.sh @@ -17,6 +17,7 @@ default_args() { "--userns=keep-id" # Map host user. "-v" "$name:/home/user:copy" # Persistent home volume. "-v" "dnf-cache:/var/cache/libdnf5" # Cache dnf metadata. + "-v" "$HOME/dev:/home/user/dev" # dev folder ) # Unix sockets require SELinux label disable. @@ -38,6 +39,7 @@ param_args() { -gpu) run_opts+=("--device" "/dev/dri") ;; -kvm) run_opts+=("--device" "/dev/kvm") ;; -usb) run_opts+=("--device" "/dev/bus/usb") ;; + -audio) run_opts+=("--device" "/dev/snd") ;; -host-spawn) run_opts+=("-v" "/run/user/$UID/bus:/tmp/bus" "-e" "HOST_HOME=$HOME") ;; -container-sock) run_opts+=("-v" "$XDG_RUNTIME_DIR/podman/podman.sock:/var/run/docker.sock") ;; -x11) run_opts+=("-v" "/tmp/.X11-unix:/tmp/.X11-unix" "-v" "$XAUTHORITY:/run/user/1000/.Xauthority:ro" "-e" "DISPLAY=$DISPLAY" "-e" "XAUTHORITY=/run/user/1000/.Xauthority") ;; @@ -50,19 +52,8 @@ param_args() { main() { local state_file="$HOME/.local/share/devc-previous-container" - local image="devc" - - # Resolve container name (CLI arg > Last used > Error). - if [[ $image && $image != -* ]]; then - shift - [[ $image != *:* ]] && image+=":main" - echo "$image" >"$state_file" - elif [[ -f $state_file ]]; then - image=$(<$state_file) - else - die "no container name specified" - fi - local name="${image%:*}" + local image="devc:main" + local name="devc" # Start/Restart if not running or if arguments change configuration. if [[ -z "$(podman ps -q -f name="^$name$" -f status=running)" ]] || (($# > 0)); then