Files
dotfiles/.config/yadm/bootstrap##distro.arch
wholteza 0ff35915ed Fix NuForce uDAC USB disconnects
Cheap Savitech chip firmware stalls on rapid SET_INTERFACE / sample-rate
renegotiation, eventually dropping off the USB bus and requiring a
physical replug. Two fixes, both scoped to this exact device only:

- snd_usb_audio quirk_flags (262a:10aa): fixed_rate + ctl_msg_delay +
  iface_delay, applied via /etc/modprobe.d during bootstrap.
- WirePlumber: disable idle-suspend for the device's ALSA node so
  PipeWire doesn't repeatedly reopen the stream during normal use.
2026-08-16 09:49:14 +02:00

107 lines
3.8 KiB
Bash
Executable File

#!/bin/bash
# Installs requirements for my arch setup.
set -euo pipefail
# Refresh the keyring first, then do the full upgrade against synced dbs.
sudo pacman -Sy --noconfirm archlinux-keyring
sudo pacman -Su --noconfirm
sudo pacman -S --needed --noconfirm \
fd \
tmux \
nvm \
telegram-desktop \
signal-desktop \
alacritty \
rofi \
ttf-jetbrains-mono-nerd \
less \
waybar \
cifs-utils \
nautilus \
bitwarden-cli \
jq \
bob \
gvfs-smb \
pcmanfm \
wl-clipboard \
openssh \
mosh
bob install nightly
bob use nightly
nvim --version
# --- ssh / mosh: public-key-only access --------------------------------
sudo systemctl enable --now sshd
install -d -m 700 "$HOME/.ssh"
touch "$HOME/.ssh/authorized_keys"
chmod 600 "$HOME/.ssh/authorized_keys"
# Public keys trusted for this account (safe to publish, no private key
# material). Snapshot of `ssh-add -L` on 2026-08-14; appended if missing,
# never removes keys added by other means.
ssh_authorized_keys=(
"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDQU7E/vo/+//WgeDPYX8wQudAQpx8FY2L7nv1wFCWaTrHqyUKL/ggmvtAXbkg9WqW/p6DmKbpDFNMKwKScK2OxjcxkPyQnmrmPW3SVU44RsN4R6Z0TKDSmVJ4wO35njYEfd8yKO4BDX8Q2T34lKHuBxqH/Q4Heknj4AEKB0l6xuHzfGumK4qN58qPZ6hFfPHffeOiYSh2hVWa/pRxbzD0ZDJ4eLXvUHPsQ+GVerLKv2ozVrhHOjouAQyuIFD86j8rUUnRp7keKawLUsmXvnO0IdJwi3c82j42+mUa8A3fb1glLGlax4glAhz3nw6v2NPk1V5BObCvT3zng3v6eteyEMW8E6qrUX3N9AUHABq4i8dkRKjQXL3V5dkAhTV0BzdxyBQ8/i8cWKGl2CZSPDzi37Si6RpiLboPtm3iY0mf74HbJPBUkA6YVYZEOLy0TPUkEQxkKVE/zI7GDe9CmGDRWOKm+naLSoQEr1/9xqAJlhz+HbWUkmam3MEaXXqDbY1s= wholteza_rsa"
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIArtt5fhcXt2IVAmU2FWfQyrFiQmV/ym/cUM6jtpJ7CA ansible"
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFFYS4L05dihHbrxX8NuPuOgAfRpMx7UJk95po5EdMQv HIT manually created id_ed25519"
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGxWpXrFMFtG4KlqfMZ2kYUTEZ1sMfvpNFSUlQBkaeq0 wholteza"
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKIZHsSfRcBFdg1pmV5ig/zZ5ZEy9iS6GiLK7kOy0Vcu HIT zacmon001"
)
for key in "${ssh_authorized_keys[@]}"; do
grep -qxF "$key" "$HOME/.ssh/authorized_keys" || echo "$key" >> "$HOME/.ssh/authorized_keys"
done
# Public-key-only: no passwords, no keyboard-interactive fallback.
# mosh's initial handshake goes through sshd, so this covers it too.
sudo install -d -m 755 /etc/ssh/sshd_config.d
sudo tee /etc/ssh/sshd_config.d/10-pubkey-only.conf > /dev/null <<'EOF'
PubkeyAuthentication yes
PasswordAuthentication no
KbdInteractiveAuthentication no
ChallengeResponseAuthentication no
AuthenticationMethods publickey
EOF
sudo systemctl reload sshd
# --- NuForce uDAC USB audio quirks --------------------------------------
# This DAC's firmware (262a:10aa) stalls on rapid SET_INTERFACE / sample
# rate renegotiation, which without these quirks eventually drops the
# device off the USB bus and requires a physical replug. Scoped to this
# exact VID:PID so it's a no-op on any machine without the device
# attached. Takes effect next time snd_usb_audio (re)probes the device
# (reboot, module reload, or replug) -- not applied retroactively here.
sudo install -d -m 755 /etc/modprobe.d
sudo tee /etc/modprobe.d/nuforce-udac-quirks.conf > /dev/null <<'EOF'
# fixed_rate (bit 21): device only offers one sample rate; stop the
# driver re-sending SET_CUR for it ("cannot set freq 48000 to ep 0x3").
# ctl_msg_delay (bit 8): 20ms pause around each USB control message.
# iface_delay (bit 11): 50ms pause around each SET_INTERFACE call.
options snd_usb_audio quirk_flags=262a:10aa:0x200900
EOF
if [ ! -d "$HOME/repos/yay" ]; then
mkdir -p "$HOME/repos"
cd "$HOME/repos"
sudo pacman -S --needed --noconfirm git base-devel
git clone https://aur.archlinux.org/yay.git
cd yay
makepkg -si --noconfirm
fi
yay -S --needed --noconfirm \
fnm \
oh-my-posh \
wezterm
export PATH=/home/$USER/.fnm:$PATH
eval "$(fnm env --use-on-cd --version-file-strategy=recursive)"
fnm install 24
fnm use 24