summaryrefslogtreecommitdiff
path: root/Biz/Bild
AgeCommit message (Collapse)Author
2024-04-10Explicitly pass Bild.nix to nix builds & expose references to stableBen Sima
This change was motivated by my testing of tabbyAPI. I kept doing like `nix-build -A pkgs.tabbyAPI` and I thought, can't bild just do this? So I wrote a file called TabbyAPI.nix with the following contents:: { bild }: bild.pkgs.tabbyAPI and it worked, I just needed this change to Bild.hs to supply the `bild` argument. The benefit of using bild here is that I can get the logging, concurrency settings, and linking to _/nix etc all by default. Plus, using a standalone nix file like TabbyAPI.nix might be a good way to pin some package in the build system and make sure it continues to build, test, and so on. Also, thie means I don't sprinkle relative paths to the Bild.nix library throughout the repo, which is bad practice anyway. Re: explicitly exposing refernces to stable: This keeps things a bit more tidy and less confusing when working on the nix library.
2024-04-10Reorganize and update nixpkgs upstreamsBen Sima
This patch does a few things: 1. Switches from nixpkgs-unstable to nixos-unstable{,-small}, simply because nixpkgs-unstable is not in cache.nixos.org, but nixos-unstable is, and -small is the same but requires all tests to pass. So we should prefer nixos-unstable-small, whenever possible. 2. Reorganizes the nixpkgs import code such that Nixpkgs.nix returns an attrset of all the nixpkgs that I want to use, rather than putting other nixpkgs branches into the main one as an overlay. This is much simpler and explicit, but it meant I had to change a lot of usages throughtout the nix codebase. 3. As a consequence of 2, moves the overlays into separate files so they can be re-used across nixpkgs branches.
2024-04-10Switch from black to ruff formatBen Sima
Ruff is faster and if it supports everything that black supports than why not? I did have to pull in a more recent version from unstable, but that's easy to do now. And I decided to just go ahead and configure ruff by turning on almost all checks, which meant I had to fix a whole bunch of things, but I did that and everything is okay now.
2024-04-02Add llama-cpp from nixos-23.11Ben Sima
Removes my custom llama-cpp build and instead pulls in the upstream build from nixos-23.11.
2024-04-02Add nixos-23_{05,11} depsBen Sima
Using the same methodology as in d56f05863d789423ff785cec654155d8495373a9, where I add additional nixpkgs via an overlay, I added access to nixos-23.11. I also renamed the nixpkgs-stable dep to be more appropriate, given that it comes from the nixos-23.05 git branch. I'm nost totally sure about the naming of the attr in the overlay, maybe it should be 'stable-23_11'? But I feel like for discoverability purposes it should be the same as the name in deps, so I'll just stick with that.
2024-04-01Add nixfmt to Lint.hsBen Sima
nixfmt is the soon-to-be official formatter for Nix code, as per the NixOS GitHub group. So I figure I should just adopt it without worrying too much about the specifics of the formatting. I just formatted everything in one go, hence the huge diff, oh well.
2024-03-28Add nixpkgs unstable as an overlayBen Sima
There are just too many packages that I need that are in nixpkgs unstable and aren't in the release branches. Using it as an overlay like this means I can just refer to the packages I want from unstable without pulling in all the changes.
2023-11-13Update radicale and set recommended headersBen Sima
This was leftover from work on the previous commit. I don't think its actually needed to get my stuff working, but these headers are recommended in the docs and the latest version supposedly has some relevant bug fixes, so I decided to commit this. - https://github.com/Kozea/Radicale/issues/838 - https://github.com/Kozea/Radicale/issues/954 - https://github.com/Kozea/Radicale/issues/1247
2023-10-31Update nixpkgsBen Sima
I need this to get gradio, I think.
2023-10-03Add rundeps feature to bildBen Sima
This allows me to specify runtime dependencies, not just system or language deps.
2023-10-03Rename BIZ_ROOT to CODEROOTBen Sima
BIZ_ROOT was too specific. CODEROOT allows for other (non-biz) projects to live in the root of the repo. I didn't want to call it GIT_ROOT because maybe someday I won't want to use git. But I'll never not use code.
2023-09-20Prototype MynionBen Sima
This implements a prototype Mynion, my chatbot which will eventually help me write code here. In fact he's already helping me, and works pretty well over xmpp. The prompt is currently not checked in because I'm experimenting with it a lot, and it should probably be a runtime parameter anyways. In the course of writing this I added some helper libraries to get me going, configured black (didn't even know that was possible), and added 'outlines' and its dependencies even though I didn't end up using it. I'll keep outlines around for now, but I'm not sure how useful it really is because afaict its just pre-defining some stop conditions. But it took a while to get it working so I'll just keep it in for now.
2023-08-22Replace pylint with ruffBen Sima
Ruff is like a million times faster, and I mostly ignored pylint's suggestions anyway. I also took this opportunity to move lint tools into a runtime dependency on Lint.hs, which meant adding a wrapper to the Haskell builder, which was easy enough. This paves the way for proper rundeps in bild.
2023-08-22Add a commit-msg hook lint and various other cleanupsBen Sima
Turns out that gitlint by default enforces the exact commit-msg format that I like to use. I'm enabling this because even I write poor commit messages sometimes, and looking back on my commits from even a few days ago is sometimes not very helpful. I also made some minor comment and nix changes that I noticed while reviewing my work from the last few days.
2023-08-21Refactor the build system for readabilityBen Sima
Lots of changes here but the code is much improved. The nix code is clearer and structured better. The Haskell code improved in response to the nix changes. I needed to use a qualified path instead of the abspath because the BIZ_ROOT changes based on whether bild runs in nix or runs in the user environment. Rather than passing every argument into Builder.nix, now I just pass the json from bild and deconstruct it in nix. This is obviously a much better design and it only came to be after sleeping on it the other night.
2023-08-17Delete BesselBen Sima
Bild does not link libraries, and idk if it ever will, so just delete this for now.
2023-08-17Nixify C buildBen Sima
This is working with libsodium as an example. Its unfortunate that we need the extra ':arg -lsodium' but how else can I get the name of the library for linking? Is that something in the nix attr metadata? Anyway, an optimization for another day.
2023-08-17Nixify rust buildBen Sima
Not getting deps yet but thats okay, I basically need to do a bunch of annoying nix work to get rustPackages into a thing like pythonPackages.
2023-08-16Get python targets buildingBen Sima
I added 'black' to Biz/Lint.hs, but not the others because they rely on dependencies being in the PYTHONPATH to work, so they are only relevant in nix builds and repls. I also made some other tweaks to the python checkPhase and linted all the files. Everything should be building and linting correctly now.
2023-08-16Log and return output to callerBen Sima
The main change here is 'puts' now returns a value, this enables me to collect the value from the conduit source while also doing stuff with it, like printing or logging it as I want. Previously I was running conduit over the source, *and then* kicking off the concurrent processes to wait for the process and collect the output. This would (I think) drain the source before it got to the 'puts' conduit run, and so I wouldn't be able to get the output streamed in real time. It took a lot of refactoring and exploratory programming to get to this relatively-small diff, but now puts works correctly. At least I think it does... it seems to work more reliably from ghci than from the shell. Maybe the shell or TERM is causing nix-store to do some buffering? Maybe I need to use the threaded runtime in GHC? Not sure, but I will look out for this issue and try to identify and fix. Update: yep it was the threaded runtime. I enabled that and now it works in the shell. I squashed that commit into this one.
2023-08-16Run lintBen Sima
Idk why these missed the linter. Probably packages updated in the nixpkgs version bump.
2023-08-16Add llama-cpp and exllamaBen Sima
2023-08-16Update nixpkgs to 23.05Ben Sima
2023-08-07Get ava.py running with nixified buildsBen Sima
I had to redo some of my python overrides and crib the bitsandbytes.nix from upstream. Ava is failing because: ValueError: Tokenizer class LlamaTokenizer does not exist or is not currently imported. I think this means I need to update my nixpkgs pin, so I'm gonna snapshot my work in git, do the update, and that might obviate the local bitsandbytes.nix anyway.
2023-08-07Working nixified python buildBen Sima
This represents quite a few evenings of hacking. It doesn't build all of my Python code, because my Python code is not up to snuff, but it builds the examples and pulls in third party dependencies. Some design points: - I'm using buildPythonApplication in Builder.nix because it was getting way too annoying to wrap the Python script and set PYTHONPATH myself. Easier and more robust to just use the upstream nix builder - Because of this, I had to generate a setup.py. Maybe switch to pyproject.toml in the future, whatever. - Also because of this, Target.wrapper is becoming redundant. I'll just remove it when I get Guile built in nix. - Biz/Bild.nix is getting messy and could use a refactor. - In Builder.nix, I worked around the empty directories bug by just finding and deleting empty directories after unpacking. If its stupid but works it ain't stupid! - I had to touch __init__.py files in all directories before building. Annoying! - `repl` just works, which is awesome - To ensure good Python code, I moved lints and added type checking to the build. So I can't build anything unless it passes those checks. This seems restrictive, but if I want to run some non-passing code, I can still use `repl`, so it's actually not inhibitory.
2023-08-07Set BIZ_ROOT in nix builderBen Sima
2023-08-07Remove unneeded nix-instantiate argumentsBen Sima
2023-08-03Move buildPhase to a nix-instantiate argumentBen Sima
2023-08-02Factor out nix builder into Haskell.nixBen Sima
This also fixed a bug where every dependency would get pulled into the Haskell target while searching for transitive dependencies.
2023-07-31Implement nix builds for HaskellBen Sima
This is prototype quality. For some reason I think it breaks when doing `build **/*.hs`, which isn't good. But also it's working, and the code feels good. Next I'd like to get Python builds working, as hopefully that will force me to improve the existing code to support a second language.
2023-07-31Prototype nix expression generationBen Sima
There are some limitations to this implementation: 1. Using `runCommand` means this will re-run any time anything changes in the repo. The solution is to use the existing import detection to make a list of source files, and put that into a `stdenv.mkDerivation`, which I'll do next. 2. The `NeatInterpolation` usage is ugly. The templated nix code should be extracted into its own file, such as `Biz/Bild/Builder.nix`. 3. I'm not actually calling it yet. The ideal thing would be to call `nix-instantiate`, get the output drv path, and then call `nix-store --realise` on that. To do that I need to refactor my `proc` function to return stdout to the calling function, and I should probably just make helper functions like `nixInstatiate :: Target -> IO DrvPath` and `nixStoreRealise :: DrvPath -> NixStorePath`, or something like that.
2023-04-28Add patched autogen for guile 3Ben Sima
2023-04-28Default to Guile 3.0 everywhereBen Sima
Without this, Guile libraries like SDL2 will use Guile 2.0 instead.
2023-01-04Deploy nostr relay serviceBen Sima
2022-12-29Update nixpkgsBen Sima
Redis was failing a test on the previous version.
2022-12-28Get ava GPT chatbot prototype workingBen Sima
Mostly thid required packaging up some deps, but also had to recompile stuff with cuda support.
2022-12-16Switch from master to nixos-22.11Ben Sima
This way I am more likely to hit the cache and not have to build everything all the time.
2022-12-15Update nixpkgsBen Sima
2022-12-01Build gnutls with guile bindingsBen Sima
2022-11-13Add test for building guile extensionsBen Sima
Guile linking was first implemented in d8fe6f7ac54f155fe5a3c33509249a70d0c816c5. This test remained uncommitted since then because I wanted a better way to test it, but I couldn't figure out another way to test it, so here we are.
2022-11-07Support cudaBen Sima
2022-10-28Factor out metadata handling into Biz.Bild.MetaBen Sima
The code was becoming repetitive and messy, with functions like 'metaDep' and so on. So that's an indication that they just need to have their own home.
2022-08-08Remove some TODOsBen Sima
I don't like TODOs in my codebase, I'd rather keep them in org files. Eventually I need a linter that prevents all TODOs from getting into code.
2022-08-05Remove args from lisp exampleBen Sima
2022-08-02Fix test argument to depsBen Sima
2022-07-29Update nixos-mailserver and deploy Biz/Cloud.nixBen Sima
The cloud was old, so some extra fixes snuck in that should have been a part of the nixpkgs upgrade.
2022-07-27Upgrade nixpkgsBen Sima
2022-07-26Port Niv.Cli to Biz.Bild.DepsBen Sima
2022-07-25Run deadnix as a linterBen Sima
2022-07-25Add basic support for building C codeBen Sima