diff --git a/setup b/setup index 5c382df..99f1e07 100755 --- a/setup +++ b/setup @@ -86,11 +86,21 @@ install_packages_ubuntu() { # --- rust setup --- setup_rust() { - if ! command_exists rustc; then - echo "🦀 installing rustup for $UNAME..." + echo "🦀 Setting up Rust toolchain for $UNAME..." + + if ! as_user "command -v cargo >/dev/null 2>&1"; then + echo "📥 Installing rustup..." as_user "curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y" fi - as_user "source ~/.cargo/env && cargo install --locked bat lsd rusty-man cargo-expand viu || true" + + # ensure PATH includes cargo bin for the current session + as_user 'export PATH="$HOME/.cargo/bin:$PATH"; rustup update stable || true' + + echo "📦 Installing Cargo tools..." + as_user 'export PATH="$HOME/.cargo/bin:$PATH"; \ + cargo install --locked bat lsd cargo-expand viu || true' + + echo "✅ Rust toolchain and CLI utilities installed." } # --- fonts --- @@ -142,10 +152,8 @@ setup_apparmor() { return 0 ;; esac - # Enable service sudo systemctl enable --now apparmor.service || true - # Check if kernel param is active if [[ "$(cat /sys/module/apparmor/parameters/enabled 2>/dev/null || echo N)" != "Y" ]]; then echo "⚠️ AppArmor not fully active." echo "👉 Add to GRUB_CMDLINE_LINUX_DEFAULT: apparmor=1 security=apparmor" @@ -154,7 +162,6 @@ setup_apparmor() { echo "✅ AppArmor kernel module active." fi - # Optional Firefox profile if [[ -f /etc/apparmor.d/usr.bin.firefox ]]; then sudo aa-enforce /etc/apparmor.d/usr.bin.firefox || true echo "✅ Firefox AppArmor profile enforced."