A new machine is a PITA. This makes it less, at least for me it does.
This repository contains scripts to automate the setup of a new development machine. It handles the installation of common development tools and applications using package managers:
- For macOS: Homebrew
- For Windows: Chocolatey
Both setup scripts now follow the same regulated-friendly lifecycle:
flowchart LR
A[preflight-validation] --> B[IQ]
B --> C[bootstrap]
C --> D[package-installation]
D --> E[OQ]
E --> F[language-dependencies]
F --> G[PQ]
G --> H[post-checks]
The qualification stages are intended to be non-mutating when run through validation flags:
- IQ validates prerequisites, package manager presence, PATH visibility, and checksum accessibility.
- OQ validates operational behavior, dependency-manager health, conflict detection, and rollback safety checks.
- PQ validates response-time, disk I/O, network responsiveness, and baseline resource thresholds.
./NewMachineSetup.shQualification-only troubleshooting flags:
./NewMachineSetup.sh --iq-only
./NewMachineSetup.sh --oq-only
./NewMachineSetup.sh --pq-only
./NewMachineSetup.sh --validate-only.\NewMachineSetup.ps1Qualification-only troubleshooting flags:
.\NewMachineSetup.ps1 -IQOnly -SkipElevation
.\NewMachineSetup.ps1 -OQOnly -SkipElevation
.\NewMachineSetup.ps1 -PQOnly -SkipElevation
.\NewMachineSetup.ps1 -ValidateOnly -SkipElevationOptional Windows Update stage:
.\NewMachineSetup.ps1 -WindowsUpdateDefault PQ thresholds can be tuned with environment variables:
NMB_MIN_RAM_MB(default4096)NMB_MIN_DISK_MB(default10240)NMB_MIN_AVAILABLE_MEMORY_MB(PowerShell PQ default512)NMB_PACKAGE_MANAGER_THRESHOLD_SECONDS(default5)NMB_NETWORK_THRESHOLD_SECONDS(default5)NMB_DISK_WRITE_MBPS_MIN(default5)NMB_LOAD_THRESHOLD_MULTIPLIER(Bash PQ default2)
Increase these thresholds for slower CI runners, or tighten them for production-like qualification hosts.
To customize the installations:
- Edit
Brewfilefor macOS Homebrew packages and applications - Edit
chocolatey.configfor Windows applications - Edit
features.txtfor Windows features - Edit
requirements.txtfor Python packages - Edit
Gemfilefor Ruby gems
Design goals in this repository:
- SOLID: each stage is orchestrated independently and low-level install logic is isolated behind dedicated functions.
- DRY: shared behavior (retry, failure tracking, operation-state tracking, summary output) is centralized in reusable helpers.
- ACID-like consistency: prerequisite validation runs first, install operations track explicit state transitions (
planned,running,succeeded,failed), and retries are applied in a controlled way.
When adding a new installer:
- Add a dedicated install function (single responsibility).
- Reuse the shared retry/failure/state helpers.
- Hook the function into the appropriate stage.
- Keep qualification and preflight checks in validation stages when new inputs or dependencies are required.
- Run
--iq-onlyor-IQOnlybefore mutating a host. - Use
--oq-onlyor-OQOnlyafter package changes to confirm dependency managers still behave correctly. - Reserve
--validate-onlyfor CI/CD or formal qualification evidence when a full non-mutating pass is required. - Treat PQ thresholds as release criteria and document any local overrides used during validation.
The Brewfile uses Homebrew Bundle, a feature that allows you to specify all your desired packages, casks, and even Mac App Store applications in a single file.
To manually install from the Brewfile:
brew bundleThe chocolatey.config is an XML file that defines all the Windows packages to install. It follows the Chocolatey package configuration format.
To manually install from the Chocolatey config:
choco install chocolatey.configAs this is my personal set up I will not be accepting package PR's. I'm sorry, but I'm not installing things I don't need. You can fork it though.