cmd / laptop
I maintain a laptop repo which sets up a macOS machine as a software development environment.
Install
Clone onto laptop:
export LAPTOP="$HOME/laptop"
git clone https://github.com/croaky/laptop.git $LAPTOP
cd $LAPTOP
Review:
less laptop.sh
Run:
./laptop.sh
What it sets up
The script can safely be run multiple times. I run it most workday mornings. It is tested on the latest version of macOS on a arm64 (Apple Silicon) chip. It:
- installs system packages with Homebrew
- sets the shell to zsh
- configures terminals Ghostty and Warp
- symlinks dotfiles from the repo to
$HOME - installs Go and Rust
- installs Go tools: deadcode, godoc, goimports, gopls
- installs language servers for Bash, Go, HTML, Lua, TypeScript
- installs the
tsgotypechecker and thedprintformatter as pinned single binaries - sets up Neovim with LSP, completion, fuzzy-finding
- starts Postgres dev and test clusters, restarting one whose settings the script has changed
No JavaScript runtime
The machine has no node, npm, or bun on it. Nothing here is a
JavaScript project, and the tools that read TypeScript ship as native
binaries: tsgo typechecks, dprint formats, and a Go program drives
esbuild through its Go API when something
needs bundling. See CDN.
The language servers took the longest to replace, because the usual ones are published only as npm packages:
- Bash: bashd, a Go server built on
mvdan.cc/shthat calls theshellcheckbinary for diagnostics, in place ofbash-language-server. - HTML: superhtml, one Zig
binary that is both a language server and a formatter, in place of
vscode-langservers-extracted. - TypeScript:
tsgo --lsp --stdio, the same binary that typechecks, in place oftsserver.
The last holdout was nvim-treesitter, whose install step runs
tree-sitter generate and reads a grammar.js. Passing
--js-runtime native reads it with the QuickJS the CLI already embeds.
See vim / tree-sitter grammar.