Skip to content

Bring moscripts up to the external-systems org standard - #1

Merged
andrewthomaslee merged 1 commit into
mainfrom
modernize-org-standard
Nov 14, 2026
Merged

andrewthomaslee merged 1 commit into
mainfrom
modernize-org-standard

Conversation

@andrewthomaslee

Copy link
Copy Markdown
Owner

Summary

Brings moscripts up to the external-systems org standard (it stays a personal repo). Every input now follows org-pkgs, so consumers stop locking a second uv2nix stack.

 inputs
-  nixpkgs                  github:NixOS/nixpkgs/nixos-unstable
-  systems                  github:nix-systems/default
-  pyproject-nix            github:pyproject-nix/pyproject.nix
-  uv2nix                   github:pyproject-nix/uv2nix
-  pyproject-build-systems  github:pyproject-nix/build-system-pkgs
+  org-pkgs                 github:external-systems/pkgs
+  nixpkgs, flake-parts, import-tree, pyproject-nix, uv2nix,
+  pyproject-build-systems  -> follows org-pkgs/*
 .
-├── flake.nix (420 lines, no flake-parts)   ├── flake.nix (org template, import-tree)
-├── apps/*.py           (shebang scripts)   ├── flake-parts/python.nix, docs.nix, _python/
-├── pythonScripts/*.py + *.py.lock (PEP 723)├── src/moscripts/{motmp,mpv_playlists,password_generator,human_timestamp}.py
-├── shellScripts/configure-vscode.sh        ├── devenv.{yaml,nix,lock}, .vscode/
-├── screenshots/                            ├── documentation/{docs,slides}/
-└── .github/workflows/flakehub-publish-…    ├── vm-tests/cli-smoke.nix
+                                            ├── .github/workflows/ci.yml, rulesets/default.json
+                                            └── AGENTS.md, CLAUDE.md, LICENSE (MIT)
  • One uv.lock (170 KB → 46 KB). The CLIs are [project.scripts] entry points. The backend is uv_build (was hatchling, which needed an editables override). The dev group is trimmed to pytest, pytest-mock, pytest-cov, ruff and pyrefly; marimo and its extras go, because motmp builds its own venv. All deps are upgraded.
  • No nix run at runtime. tool_prefix() finds gum, uv or mpv on PATH, and the package appends pinned copies (--suffix PATH). Importing moscripts no longer asserts that nix or ~/Music/Playlists exist, so --help works anywhere.
  • Outputs: packages.default (all four CLIs), moscripts-venv, apps.<cli>. The container images are dropped.
  • Checks: pytest, pyrefly, ruff (rules pinned in pyproject), uv-lock, plus org treefmt, docs, slides and lock-sync.
  • CI: the org ci.yml (major: 0, minor: 2, so releases are 0.2.<commits>). The FlakeHub/Determinate publish workflow is removed. In the ruleset, RepositoryRole admin (id 5) replaces OrganizationAdmin, which doesn't exist on a personal repo.
  • Docs: https://andrewthomaslee.github.io/moscripts/ with one page per CLI, a development page and a deck.

Evidence

  • Before: nix flake check ran pytest with nix inside the sandbox. mpv_playlists --help failed without ~/Music/Playlists. Every gum, uv or mpv call ran nix run nixpkgs#….
    After:
    nix run .#flake-check                          -> all checks passed!
      moscripts-pytest   35 passed
      moscripts-pyrefly  0 errors
      moscripts-ruff     All checks passed!
    vm-test cli-smoke --remote --rebuild           -> cli-smoke passed (126s, fresh boot)
      subtests: --help for all 4 · pinned gum/uv/mpv on wrapper PATH ·
                password_generator · human_timestamp · mpv_playlists
      ('/nix/store/…-mpv-with-scripts-0.41.0/bin/mpv', '--loop-playlist', '--no-video', '…/road-trip.m3u')
    nix eval .#packages.aarch64-linux.default.drvPath -> evaluates
    devenv shell: python -c 'import moscripts' -> …/moscripts/src/moscripts/__init__.py (editable)
    
  • Lock: the root inputs are all org-pkgs follows. Once pkgs switches to github:andrewthomaslee/moscripts with inputs.org-pkgs.follows = "" (next PR), moscripts costs pkgs, modules and home one node each, down from five. That was tested with a throwaway flake: follows = "" resolves to the root flake.

Merge Danger

Door: two-way

Revert restores the old flake. pkgs still pins the FlakeHub 0.1.0 tarball until its own PR, so nothing downstream changes on merge.

Blast Radius: contained

  • Renamed outputs: per-script packages and *-container images are gone; apps.<cli> and packages.default remain. hello is removed.
  • password_generator and human_timestamp are no longer standalone PEP 723 scripts (uv run file.py).
  • After merge (owner): Settings → Pages → Source: GitHub Actions, then gh api -X POST repos/andrewthomaslee/moscripts/rulesets --input .github/rulesets/default.json.
  • Merge order: this PR → pkgs (moscripts input) → modules (nix flake update org-pkgs + sync-locks) → home.

🤖 Generated with Claude Code

Follow external-systems/pkgs for nixpkgs, flake-parts, import-tree and
the uv2nix pins, so consumers (pkgs, modules, home) stop locking a second
uv2nix, pyproject.nix and build-system-pkgs. Replace the FlakeHub /
Determinate publish workflow with the org CI, add the devenv shell, docs
site, slide deck, VM test, AGENTS.md and an MIT license.

The CLIs move into the package as [project.scripts] entry points (one
uv.lock, uv_build backend), and resolve gum/uv/mpv from PATH with pinned
fallbacks instead of calling `nix run` at runtime.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@andrewthomaslee
andrewthomaslee merged commit 4b47154 into main Nov 14, 2026
3 checks passed
@andrewthomaslee
andrewthomaslee deleted the modernize-org-standard branch November 14, 2026 15:55
andrewthomaslee added a commit to external-systems/home that referenced this pull request Nov 14, 2026
#54)

## Summary

```diff
 org-pkgs  → cd8dedf   (external-systems/pkgs#34: moscripts from GitHub, org-pkgs.follows = "")
 modules   → 551b179   (external-systems/modules#48: same org-pkgs bump)
-  moscripts' own uv2nix, pyproject-nix, pyproject-build-systems, systems
```

`nix flake update org-pkgs modules`, then `sync-locks` in the same
commit.

## Evidence

- **Before:** `flake.lock` has 58 nodes. netsa's `home.packages` has
moscripts 0.1.0 (FlakeHub).
**After:** 54 nodes. netsa's profile evaluates `moscripts-0.2.0` and
builds `/nix/store/sab5yqw…-moscripts-0.2.0`, the same path pkgs builds.
- `check` → exit 0, all checks passed, every machine evaluates. The only
warning is the existing `stdenv.isDarwin` deprecation.

## Merge Danger

**Door:** two-way

Lock-only change; revert restores the previous pins.

**Blast Radius:** netsa's profile

- moscripts 0.2.0 has the same CLI names. Its closure now includes
pinned `gum`, `uv` and `mpv`; before, they were fetched at runtime with
`nix run`.
- Deploy is the owner's step: `clan machines update kamrui-h1` (and the
other machines with netsa).
- Merge order: andrewthomaslee/moscripts#1 → pkgs#34 → modules#48 →
**this** (all upstream merged).

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant