From 537c1c99a24232de3f61f3524990315bb279a8e1 Mon Sep 17 00:00:00 2001 From: buckn Date: Tue, 28 Oct 2025 22:49:50 -0400 Subject: [PATCH] ud --- setup | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) 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."