summaryrefslogtreecommitdiff
path: root/Omni/Bild.nix
AgeCommit message (Collapse)Author
25 hoursFix NixOS integration: separate package building from OS buildsBen Sima
Problem: Calling bild.run inside NixOS configs triggered IFD during OS evaluation. ANSI escape codes from bild broke JSON parsing in Nix sandbox, causing build failures. Root cause: bild.run uses IFD (Import From Derivation) which runs bild --plan during Nix evaluation. When this happened inside NixOS service definitions, it ran recursively and bild output ANSI codes that corrupted the JSON analysis output. Solution: Two-phase architecture + NO_COLOR support 1. Biz/Packages.nix: Pre-builds all packages outside NixOS context 2. Biz.nix: Accepts packages as function argument (default: Packages.nix) 3. Omni/Bild.nix: Sets NO_COLOR=1 in analysis derivation 4. Omni/Log/Terminal.hs: Respects NO_COLOR env var 5. Omni/Log/Terminal.hs: Skip getTerminalSize when NO_COLOR set to avoid escape code output 6. Omni/Log/Concurrent.hs: Skip line initialization without ANSI support Now NixOS builds succeed: - Package IFD happens once at top level - No recursive builds during service evaluation - Clean JSON output from bild --plan in Nix sandbox - NixOS configs reference pre-analyzed packages Changes: - Add Biz/Packages.nix - standalone package builder - Update Biz.nix to accept packages argument - Update Biz/Dragons/Analysis.nix to use Packages.nix - Remove Biz/Targets.nix (replaced by Packages.nix) - Add NO_COLOR support throughout logging stack - Fix ANSI.getTerminalSize outputting escape codes when NO_COLOR set Amp-Thread-ID: https://ampcode.com/threads/T-bc0f6fc7-46bf-4aa2-892e-dd62e7251d4b Co-authored-by: Amp <amp@ampcode.com>
26 hoursrefactor(bild): simplify terminal output - use --loud flagBen Sima
- Remove BILD_OUTPUT_MODE environment variable - Simplify to 2 modes: MultiLine (≥80 cols) and SingleLine (<80) - Use existing --loud flag to disable concurrent UI entirely - When --loud: show all compiler output line-by-line (for debugging) - When not --loud: adaptive concurrent UI based on terminal width This is simpler and uses the existing --loud flag instead of adding new configuration. The --loud flag was already meant for debugging, so it makes sense to use it to show all output. Note: Omni/Bild.nix updated to include new Omni/Log/Terminal.hs module. Blocked by: stdin bug (see _/llm/STDIN_BUG.md) - cannot test build yet.
36 hoursfix(bild): per-module builds + exit code propagationBen Sima
- Fix nixBuild to propagate exit code from realise step - Previously used >> which discarded exit code - Now checks realise result before running symlink - Fixes false success checkmarks on build failures - Fix per-module Nix derivations - Use cp -rL instead of tar (src is directory not tarball) - Add coreutils and findutils to pkgs - Copy deps to . and use -i. for GHC - Use find with --parents to preserve module hierarchy - Set dontStrip=true to avoid fixup script errors - Tested: Example.hs, Task.hs, Dragons.hs, Bild.hs all build - Known issue: makeWrapper fixup scripts have unbound vars (Nix bug)
45 hoursAdd ansi-terminal dep and Omni/Log/Concurrent to Bild.nixBen Sima
- Add ansi-terminal to ghcPackageSetBild dependencies - Add Omni/Log/Concurrent.hs to source fileset - Fix unused mLineNum warning in buildTarget - Alphabetize deps list (hostname moved up) Parallel builds now fully functional with proper Nix dependencies.
4 daysFix billing migration to work with SQLite ALTER TABLE limitationsBen Sima
- Remove UNIQUE constraints from ALTER TABLE statements (SQLite doesn't support adding constraints via ALTER TABLE) - Add better logging for migration failures (debug level) - Rely on application logic to ensure uniqueness instead of DB constraint - This fixes the silent failure where stripe_customer_id and stripe_subscription_id columns weren't being added
4 daysAdd complete Stripe billing integration to PodcastItLaterBen Sima
- Implement Biz.PodcastItLater.Billing with checkout sessions, billing portal, webhook handling - Add subscription database schema: plan_tier, stripe fields, period dates, stripe_events table - Three-tier pricing: free (10/month), personal (/month, 50 articles), pro (9/month, unlimited) - Usage tracking and enforcement with tier-based limits - Full billing UI with plan display, usage stats, pricing cards, upgrade buttons - Dashboard shows current tier with billing button - Update Web.nix with Stripe environment variables - Fix POST redirects to Stripe with 303 status code for CloudFront compatibility Amp-Thread-ID: https://ampcode.com/threads/T-c139e5b5-1901-4cd6-8030-5623bfe1df35 Co-authored-by: Amp <amp@ampcode.com>
2025-08-30Switch to nixos-unstable branchBen Sima
According to Claude, the nixos-unstable branch has more stuff in it's binary cache than nixos-unstable-small. Idk, let's try it and find out.
2025-08-28Prototype PodcastItLaterBen Sima
This implements a working prototype of PodcastItLater. It basically just works for a single user currently, but the articles are nice to listen to and this is something that we can start to build with.
2025-06-13Re-enable datasette, llm, and aiderBen Sima
I had to update nixos-unstable-small and nixos-24_11 and disable a bunch of tests, and then re-compile like the whole world, but aider is actually working, finally.
2025-05-07Switch Python to unstable and add pydantic-aiBen Sima
Pydantic-ai is an agent framework that seems simple and good: well-typed with pydantic, tool usage is just an `@tool` decorator on a function, and so on. While building these I realized there were some deps they needed that were already in nixpkgs unstable, so I just switched to that instead of trying to backport all the versions and stuff.
2025-04-11Update, disable aider, datasette, and jupyterBen Sima
These are broken in upstream nixpkgs. Updating didn't fix them, so I'm just gonna disable them for now. I'm using pipx to install aider anyway. Also: Remove _ literal from GLOBIGNORE. I think it was causing the **/* glob to include stuff in the cabdir, idk why.
2025-03-18Add aider to the dev environmentBen Sima
This seems more complete than gptme so I'll test itnout for a while.
2025-02-06Update nixpkgs and stupid fixesBen Sima
Some things got through the CI system, probably during updates. So I had more stupid little fixes to do. I should really improve bild to the point that these won't happen anymore and builds don't take so long.
2025-01-06Add GitStats serverBen Sima
I often want to view gitstats but I always forget how to generate and view them, so this script simply captures this workflow and tests that it continues to work.
2025-01-02Switch to alejandra for nix formattingBen Sima
I mostly wanted a formatter that would format `inherit` blocks vertically, because otherwise they are super hard to read when diffing or even just editing. Both alejandra and the new nixos/nixfmt format verically like this, but alejandra has slightly better format (I guess) and for some reason nixfmt did not respect my `GLOBIGNORE` setting when doing `nixfmt **/*.nix` so it was trying to format stuff in `_/nix`, and failed. So anyway I went with alejandra. - https://github.com/kamadorueda/alejandra - https://discourse.nixos.org/t/enforcing-nix-formatting-in-nixpkgs/49506
2024-12-31Upgrade nixos 24.05 -> 24.11, ghc 9.4.8 -> 9.6.6Ben Sima
It's good to update, I think nixos 24.05 was deprecated anyway. The iPython dontCheck is because there was a test timeout; I don't even know why iPython is being pulled in but whatever.
2024-12-21Create a bootstrap image for Digital Ocean dropletsBen Sima
I need a way to reliably get a NixOS VM provisioned in the cloud, and the easiest way to do this is to create a qcow2 image, upload it to Digital Ocean, and use that to start a droplet. This is very much a manual process, but that's fine, I shouldn't need to do it very often (for now).
2024-12-21Package ludicBen Sima
This required upgrading to python 3.12 because of some f-string format thing that ludic uses. It's kind of annoying but the upgrade was easy enough, so I just did it.
2024-12-21Add datasette to dev environmentBen Sima
This is handy for looking at llm chat history.
2024-12-21Add llm binary to dev environmentBen Sima
I forgot to add llm to this, instead I just added the extra libraries, which meant I had the libraries present but not the binary for running them! And llm is important in the base dev environment because I need to experiment with the various llms independent of my application code.
2024-12-21Re-namespace some stuff to OmniBen Sima
I was getting confused about what is a product and what is internal infrastructure; I think it is good to keep those things separate. So I moved a bunch of stuff to an Omni namespace, actually most stuff went there. Only things that are explicitly external products are still in the Biz namespace.