# ============================================================================= # Windows Bootstrap Script # Reproducible dev environment setup via Scoop # ============================================================================= Write-Host "==> Checking for Visual Studio installation..." -ForegroundColor Cyan $vsInstalled = Get-ItemProperty "HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*" -ErrorAction SilentlyContinue | Where-Object { $_.DisplayName -like "Microsoft Visual Studio*" -and $_.DisplayName -notlike "*Build Tools*" } if (-not $vsInstalled) { winget install --id Microsoft.VisualStudio.2021.Community --source winget --force --override "--add Microsoft.VisualStudio.Component.VC.Tools.x86.x64 --add Microsoft.VisualStudio.Component.VC.Tools.ARM64 --add Microsoft.VisualStudio.Component.Windows11SDK.22621 --addProductLang En-us" } Write-Host "==> Visual Studio found, continuing." -ForegroundColor Green #region Scoop Installation Write-Host "==> Configuring execution policy..." -ForegroundColor Cyan Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser -Force if (-not (Get-Command scoop -ErrorAction SilentlyContinue)) { Write-Host "==> Installing Scoop..." -ForegroundColor Cyan Invoke-RestMethod -Uri https://get.scoop.sh | Invoke-Expression } else { Write-Host "==> Scoop already installed, skipping." -ForegroundColor Yellow } #endregion #region Scoop Packages Write-Host "==> Adding 'main' bucket..." -ForegroundColor Cyan scoop bucket add main Write-Host "==> Adding 'main' bucket..." -ForegroundColor Cyan scoop bucket add extras $packages = @( "main/git", "main/task" "main/fzf", "main/ripgrep", "main/nu", "main/nodejs", "main/go", "main/neovim", "main/python" ) scoop install main/llvm scoop install main/mingw scoop install main/clangd scoop install main/quickjs if (-not (Get-Command rustup -ErrorAction SilentlyContinue)) { Write-Host "==> Installing Rust via rustup..." -ForegroundColor Cyan Invoke-WebRequest -Uri "https://win.rustup.rs/x86_64" -OutFile "$env:TEMP\rustup-init.exe" Start-Process -FilePath "$env:TEMP\rustup-init.exe" -ArgumentList "-y" -Wait $env:PATH += ";$env:USERPROFILE\.cargo\bin" } else { Write-Host "==> Rust already installed, skipping." -ForegroundColor Yellow } cargo install tree-sitter-cli foreach ($pkg in $packages) { Write-Host "==> Installing $pkg..." -ForegroundColor Cyan scoop install $pkg if ($pkg -eq "main/neovim") { Write-Host "==> Fetching Neovim config (init.lua) from GitLab..." -ForegroundColor Cyan $nvimConfigDir = "$HOME\AppData\Local\nvim" New-Item -ItemType Directory -Force -Path $nvimConfigDir | Out-Null Invoke-RestMethod ` -Uri "https://gitlab.com/api/v4/projects/bartal-lsn%2Fdotfiles/repository/files/nvim%2F.config%2Fnvim%2Finit.lua/raw?ref=main" ` -OutFile "$nvimConfigDir\init.lua" Write-Host "==> Neovim config saved to $nvimConfigDir\init.lua" -ForegroundColor Green } } #endregion Write-Host "" Write-Host "==> Bootstrap complete." -ForegroundColor Green