feat: universal Nix setup with phase architecture, testing, and CI#244
Open
szymonos wants to merge 46 commits into
Open
feat: universal Nix setup with phase architecture, testing, and CI#244szymonos wants to merge 46 commits into
szymonos wants to merge 46 commits into
Conversation
szymonos
force-pushed
the
feat/universal-nix-setup
branch
5 times, most recently
from
April 18, 2026 14:13
8673920 to
e13f03c
Compare
szymonos
force-pushed
the
feat/universal-nix-setup
branch
from
April 19, 2026 06:17
6e8a83e to
4d792b6
Compare
Move check_*, fix_*, and setup_* scripts from .assets/provision/ into dedicated .assets/check/, .assets/fix/, and .assets/setup/ directories. Update all path references in Vagrantfiles, Dockerfiles, linux_setup.sh, and source.sh. Remove obsolete cert-fix and brew/pixi install scripts. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…agement Introduce nix/setup.sh as the primary entry point for all platforms (macOS, Linux, WSL, containers). Uses a buildEnv flake for user-scope, rootless, idempotent package management with JSON-driven scope system, dependency resolution, and install ordering. Key components: - Phase library architecture (nix/lib/phases/) with _io_* test stubs - Scope system (.assets/lib/scopes.sh/json) with dep resolution and sorting - nx CLI for pin, rollback, scope, overlay, and doctor commands - Per-scope configure scripts, profile injection, and install records - Starship and oh-my-posh prompt engine support with mutual exclusivity - WSL orchestration updates for Nix path integration - Certificate trust chain support for corporate proxies Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add comprehensive unit tests for the Nix setup system: - 13 bats test files covering scopes, phases, nx CLI, overlays, profiles - 9 Pester test files covering PowerShell modules and nx commands - Pre-commit hooks: check-bash32, validate-scopes, run-bats, run-pester, align-tables, gremlins-check (via prek, not pre-commit) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…tests - test_linux.yml: runs nix/setup.sh in daemon and no-daemon (Coder) modes - test_macos.yml: tests on macOS 14/15 with bash 3.2 and BSD sed - repo_checks.yml: runs pre-commit hooks via prek - Docker smoke test images for legacy and nix setup paths - Makefile targets: lint, test, test-unit, test-nix, test-legacy Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
szymonos
force-pushed
the
feat/universal-nix-setup
branch
from
April 19, 2026 19:56
e05b3f1 to
347495f
Compare
build_ca_bundle on macOS silently did nothing when the nix CA bundle at ~/.nix-profile/etc/ssl/certs/ca-bundle.crt was missing (e.g. nix profile add failed). Now checks a second nix path and falls back to exporting system root CAs from macOS Keychain via security command. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
On macOS the Keychain is the authoritative trust store and already contains corporate/MITM proxy certs (installed by MDM or pkg). Export all trusted certificates from SystemRootCertificates and System keychains via `security find-certificate`. This removes the dependency on cert_intercept and the MITM probe for macOS — the bundle is always created when build_ca_bundle runs. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
On macOS, call build_ca_bundle (Keychain export) unconditionally before the MITM probe — it doesn't need cert_intercept. Then set NIX_SSL_CERT_FILE, SSL_CERT_FILE, and git http.sslCAInfo right away so they're available for git.sh and profiles.zsh. The MITM probe + cert_intercept now only runs as a fallback when no bundle exists (Linux, or macOS edge cases). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Profile renderers used `command -v` to detect nix-installed tools, which fails on fresh macOS where ~/.nix-profile/bin may not be in PATH during setup. Replaced with `[ -x "$HOME/.nix-profile/bin/<tool>" ]` checks (matching the approach PowerShell profiles already use successfully). Moved zsh plugins section before completions in .zshrc block - zsh-autocomplete calls compinit (which defines compdef), and uv/kubectl/fzf completions depend on compdef being available. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The guard `[ -z "$BASH_VERSION" ] && return 0` was originally added to prevent dash (via /etc/profile.d/) from sourcing bash-specific syntax. In the nix path, these files are only sourced from managed .bashrc/.zshrc blocks — never from profile.d — so the guard is unnecessary and breaks all aliases and functions (including nx, devenv, cert_intercept) in zsh. Removed from: aliases_nix.sh, aliases_git.sh, aliases_kubectl.sh, functions.sh. Kept in aliases.sh (legacy Linux path, not nix-sourced). The bash-only completion block in aliases_nix.sh (COMP_WORDS, compgen, complete) is now wrapped in its own `[ -n "$BASH_VERSION" ]` check. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add executive-focused documentation site using mkdocs-material with mermaid diagrams, covering architecture, extensibility, platform support, and enterprise readiness. Includes GitHub Actions workflow for automated deployment via uv. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add mkdocs-build pre-commit hook to validate documentation builds on every commit. Add mkdocs-serve Makefile target for local development with live reload. Move pre-existing docs to docs/legacy/ and remove them from navigation. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Port cspell-cli spell checking and validate-docs-words hooks from reference repo. Fix letter/digit boundary splitting in tokenizer to match cspell behavior. Fix three typos caught by cspell in legacy docs. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Rewrite index.md with quality proof points and sharper problem framing. Add design decisions (why Nix, why not golden images, why bash 3.2, why bootstrapper), quality & testing showcase, enterprise readiness assessment, corporate proxy handling, and customization guide. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Show three setup paths (WSL via wsl_setup.ps1, macOS with auto Nix install, Coder/containers with pre-installed Nix) using admonition tabs instead of a single manual Nix install block. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
szymonos
force-pushed
the
feat/universal-nix-setup
branch
from
April 21, 2026 21:32
ee342d0 to
2667565
Compare
…edential helper Request admin:public_key during gh auth login to avoid a second auth prompt for SSH key registration. Add gh auth setup-git after authentication to fix git credential issues on macOS with dual gh installs (brew + nix). Retain scope refresh fallback for users with pre-existing tokens that lack the scope. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
szymonos
force-pushed
the
feat/universal-nix-setup
branch
from
April 22, 2026 05:22
5186d20 to
5f25953
Compare
szymonos
force-pushed
the
feat/universal-nix-setup
branch
3 times, most recently
from
April 22, 2026 06:40
3c6e33e to
9ee299e
Compare
szymonos
force-pushed
the
feat/universal-nix-setup
branch
from
April 22, 2026 06:40
9ee299e to
0043d18
Compare
…ions Split design decisions into high-level architecture choices (Why Nix, Why not golden images, Why bootstrapper) and implementation decisions (bash 3.2 compatibility, oh-my-posh/starship vs oh-my-zsh, managed blocks, phase-based orchestration, JSON shared schema). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…e pages Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Introduces Nix as a cross-platform package manager for reproducible dev environment setup on Linux and macOS, with a phase library architecture, comprehensive testing framework, CI workflows, and repository restructuring.
Commits
1.
refactor:reorganize provision scripts into check, fix, and setup dirsReorganizes
.assets/provision/into purpose-specific directories:check_*.sh→.assets/check/fix_*.sh→.assets/fix/setup_*.sh,set_*.sh→.assets/setup/Removes deprecated scripts (
install_brew.sh,install_pixi.sh,fix_certifi_certs.sh). Updates all path references in Vagrantfiles, Dockerfiles,linux_setup.sh, andsource.sh.2.
feat:Nix-based cross-platform setup with declarative package managementCore infrastructure for managing dev tools via Nix:
nix/lib/phases/) — setup.sh is a slim ~120-line orchestrator that sources 8 phase libraries (bootstrap, platform, scopes, nix_profile, configure, profiles, post_install, summary). Each phase uses_io_*wrappers (_io_nix,_io_run,_io_curl_probe) for testability.nix/setup.sh— main entry point for all platforms (macOS, Linux, WSL, containers). User-scope, rootless, idempotent.nix/flake.nix— declarative package set usingbuildEnvnix/scopes/*.nix) — base, shell, python, k8s, az, docker, terraform, etc..assets/lib/scopes.jsondefines valid scopes, dependency rules, and install order;.assets/lib/scopes.shprovides resolution logic (bash 3.2 compatible)nxCLI — declarative package management commands: install, remove, list, scope add/remove, pin, rollback, overlay, doctornix/configure/) — per-scope setup for profiles, starship, omp, gh, git, conda, docker, azfix_{azcli,gcloud,nodejs}_certs.shfor corporate proxy environmentswsl_setup.ps1extended with Nix path support.assets/lib/install_record.shfor provenance tracking3.
test:bats and Pester unit testing with pre-commit hooksBats tests (13 test files):
test_nix_setup.bats— config generation, scope merging, arg parser, prompt exclusivity, nix profile operationstest_scopes.bats— scope helpers, validation, dependency resolutiontest_nx_commands.bats,test_nx_scope.bats,test_nx_pkgs.bats— nx CLI operationstest_nx_doctor.bats,test_overlay.bats— diagnostics and overlay systemtest_profile_block.bats,test_profile_migration.bats— profile injectiontest_source.bats,test_functions.bats,test_git_aliases.bats,test_fixcertpy_discovery.batsPester tests (9 test files):
NxCommands.Tests.ps1,NxHelpers.Tests.ps1,Scopes.Tests.ps1— PowerShell nx and scope logicConvertCfg.Tests.ps1,ConvertPEM.Tests.ps1,GetLogLine.Tests.ps1,InvokeCommandRetry.Tests.ps1,JoinStr.Tests.ps1,WslSetup.Tests.ps1Pre-commit hooks (via
prek):check_bash32.py— enforces bash 3.2 compatibility on nix-path filesvalidate_scopes.py— scope definition consistency between JSON and .nix filesrun_bats.py/run_pester.py— auto-detect and run affected testsalign_tables.py— markdown table alignmentgremlins.py— unwanted Unicode character detection4.
ci:Linux and macOS integration test workflows with Docker smoke teststest_linux.yml— runsnix/setup.shin daemon and no-daemon (Coder) modestest_macos.yml— tests on macOS 14/15 with bash 3.2 and BSD sedrepo_checks.yml— pre-commit hooks via prekDockerfile.test-nix,Dockerfile.test-legacy)lint,test,test-unit,test-nix,test-legacy5.
docs:ARCHITECTURE.md, CONTRIBUTING.md, and project documentationARCHITECTURE.md— file classification, call tree, runtime layout, bash 3.2/BSD sed constraints, phase library conventionCONTRIBUTING.md— dev workflow, pre-commit hooks, testing patterns (_io_*stubs), style referenceCLAUDE.md— updated project overview and coding guidelinesAGENTS.md,SUPPORT.md,CHANGELOG.mddocs/corporate_proxy.md,docs/customization.md— user-facing guides6.
chore:update configs, aliases, PS module fixes, and minor script tweaksIDictionaryparam types,LogContextvariable rename,Join-Strdefault parameter setTest plan
make lintpasses (all pre-commit hooks clean)make test-unitpasses (bats + Pester)make test-nixpasses (Docker smoke test)test:linux,test:macos)nix/setup.sh --shell --pythonon a clean environment🤖 Generated with Claude Code