From 3c209ac74506fa202b713bdb6777b2c45f4829d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?bartal=20l=C3=A6arsson?= Date: Wed, 10 Jun 2026 14:08:28 +0200 Subject: [PATCH] initial commit --- bootstrap.ps1 | 88 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 88 insertions(+) create mode 100644 bootstrap.ps1 diff --git a/bootstrap.ps1 b/bootstrap.ps1 new file mode 100644 index 0000000..04fd775 --- /dev/null +++ b/bootstrap.ps1 @@ -0,0 +1,88 @@ +# ============================================================================= +# 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