summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2024-04-10Report cli errors on runBen Sima
This is mostly helpful when debugging or writing programs, not during usage, but I shouldn't be suppressing errors anyway. My first version of this patch used `Biz.Log` instead of `panic`. Unfortunately this exposed a bug in bild: Control/Concurrent/Go.hs (and others) failed to build because it imported `Biz.Cli` which imported `Biz.Log`, and bild couldn't find `Biz/Log.hs`. So apparently my function `detectHaskellImports` doesn't detect all Haskell imports, somewhere along the lines I cut the graph short instead of recursing. I guess that will be a project for another day.
2024-04-10Fix --fix/-f in Lint.hsBen Sima
Apparently, docopt only parses short opts if they are separated by a single space from the long opt. I used two spaces, to make it line up with -h below. :facepalm: So anyway just flip them, to line up.
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-10Fix --cpus and --jobsBen Sima
This patch fixes two problems: 1. Apparently the docopt spec wasn't written correctly, I needed to add a metavar (like N for number) to the spec so that docopt would correctly parse the command line args. Without this, I had just been using the default 6 and 10 that I hardcoded. 2. I never added the --max-jobs and --cores flags to NixBuild, so anytime I built a nix target, i.e. any of my NixOS images, it would use all of the available cores. I think this is part of why I struggled so much to build webkitgtk: I *thought* I was limiting the resources to prevent an OOM crash, but I wasn't. With this fix, I can comfortably limit resources for a build, so I can continue working while building something in the background.
2024-04-10Don't analyze namespaces we can't buildBen Sima
Such a simple change but could potentially save seconds on every bild invocation because I have to go to disk and read the file and so on. I really should have caught this the first time I wrote it.
2024-04-10Only load .envrc.local if presentBen Sima
Otherwise, every direnv reload will print an error. Its harmless, but still annoying.
2024-04-10Save commit message if gitlint failsBen Sima
I got annoyed losing my well-crafted commit message one too many times.
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-10Add mypy to Python REPLBen Sima
I tried to add it to Lint.hs but I can't because mypy needs the target's external libraries in its environment to load and check the types for that dependency. So instead, I just added a function to the REPL environment that runs the type checker. I already had mypy in the REPL environment so I must have started down this path before and just didn't add the REPL tooling. The automatic typechecking on load feels like Haskell. A previous version of this patch had just provided a `typecheck()` function to the REPL, but it felt awkward to type all that out just to check my code after loading it. I would like to bind a key like ctrl-r or alt-r to the `reload()` function, but I'm not sure how to do that. I think Python uses GNU readline so there should be some docs, but a first pass search didn't find what I needed.
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-10Push ci notes automaticallyBen Sima
I always want to push notes on a successful code push, so using the pre-push hook to do so is perfect. This also expands the pre-push hook to handle new/deleted branches, configures notes automatically, and finally checks that commit messages are decent with gitlint, since `git amend` can bypass the git commit-msg hook.
2024-04-10Improvements to the Python replBen Sima
Adding some helpful info to the repl startup because I kept forgetting that I even had this reload function. Also, don't call it 'r' because I often do like r = some_function() to store results, and then I can't reload anymore.
2024-04-10Use direnv to set environment in git test runsBen Sima
To properly run the tests, I need more than just `$CODEROOT`, unfortunately. For example, I also need to be sure I'm using the `bild` version compiled in that environment, and the `lint` from `_/bin/lint`. So anyway just use the full direnv environment.
2024-04-09Replace tidy.sh with git clean, add it to ciBen Sima
I realized that tidy was doing the same thing as git clean, but git clean can do it more robust and exactly. So switch to that and add it to the git test config aliases so I don't accidentally test with old artifacts.
2024-04-09Skip tests that require networkBen Sima
This started failing recently, I think because my key expired or something. Anyway I shouldn't be doing network requests in unit tests. So until I figure out how to design a test suite that can handle network requests in a sensible way, just skip these tests.
2024-04-03Hardcode hooksPath in bildBen Sima
This seems to be needed for git test to work, specifically because in a new worktree, git is not configured, and direnv is not loaded to auto-configure these settings. At least that's as far as I can tell what's going on. In either case, best not to rely too much on git anyway.
2024-04-03Set CODEROOT dynamically in nix buildsBen Sima
This seems to be needed for git test to work, in particular the directory inside the nix sandbox is like '/build/<name-of-checkout-directory>' which, in the case of git test, is the name of the worktree that git-branchless uses to checkout the commit under test. This is something like 'test-worktree-2'. So, I can't hardcode anything there.
2024-04-03Don't exit CI script on failureBen Sima
The whole point is to catch errors and write the result to the git notes, if the process exits then we can't do that.
2024-04-03Enable CI for every commitBen Sima
Uses git test to run CI on every commit before push.
2024-04-03Configure git test commandBen Sima
This is a command from git-branchless that will run and verify tests on all commits in the revset. Now that the bild is stable and fast enough, I should be able to use this to validate all commits before publishing, perhaps even running the pre-push CI script.
2024-04-03Update comment to CI scriptBen Sima
It got out of sync with the code even within commit 7597d51ed4c866f596fb690d4d53d70bc01181b4, I dunno how I let that happen.
2024-04-02Update direnv 1.5.1 -> 3.0.4Ben Sima
As a followup to 6040b2ceae7e6f4a0d41052663bf7826d1e52b4a, maybe this will improve the direnv loading time & frequency issue.
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-02Disable direnv watching a few filesBen Sima
I think these were false-positives and causing unnecessary re-evals of my nix code. So sometimes after a checkout I would end up just waiting a few seconds for my environment to come back, and that's annoying.
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-01Disable NetworkManager-wait-online.serviceBen Sima
This seems to be a bug in nixos, and disabling it is easy enough and doesn't seem to break anything. https://github.com/NixOS/nixpkgs/issues/180175
2024-04-01Make bild exception for git hooksBen Sima
Apparently git hooks don't get called if they have a file extention, so these weren't getting called at all since commit 904de577261e7024373e7a42fd763184764238f9. So this renames them back to the extension-less versions, and adds an exception in bild for files in the core.hooksPath directory. Unfortunately this means Lint.hs will silently ignore these files, but I guess that's okay for now.
2024-04-01Set border and window placement in ftags/hoog scriptsBen Sima
I just like these UI settings better is all.
2024-04-01Rename .bash files to .shBen Sima
I was already using .sh to refer to shell scripts. When I added .bash, I didn't realize that the linter was set to act on .sh files and not .bash files, so all of these bash scripts escaped the linter. This commit renames them to .sh, removes the .bash extension support from Biz.Namespace, and fixes all the reported shellcheck errors.
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-04-01Update my IP addressBen Sima
I (finally) switched my ISP account from my parents into my name, and they had to restart my modem (ONT box?) to process this. So I got a new IP address.
2024-04-01Add --jobs and --cpus to bildBen Sima
By default, nix will use the maximum amount of cores available to the machine. On my machine it was maxxing out the CPUs and then actually running out of RAM when compiling JavaScriptCore and literally shutting down my machine. So, I need to be able to control the concurrency and parallelism. The default settings I chose should reserve 4 cores for the user. I also changed --json to --plan because -j makes more sense for --jobs, as its used this way in other tools like make and nix-build.
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.
2024-03-25Few tweaks to MynionBen Sima
These just helped me when I tried to use it again and it didn't work and I wasn't immediately sure why.
2024-03-25Add some video modules for OBSBen Sima
2024-01-10Enable eternal terminal on berylliumBen Sima
This should probably be enabled everywhere... oh well.
2024-01-06Switch to gnome in berylliumBen Sima
I couldn't get my monitor to work properly in xmonad, so decided to use gnome for a while because I'll be away and will be using it headless from my macbook anyway.
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-11-06Add public collection for radicaleBen Sima
This will allow me to create a public calendar to share with people instead of using my iCloud calendar.
2023-10-31Update nixpkgsBen Sima
I need this to get gradio, I think.
2023-10-30Disabled broken xmpp domainsBen Sima
These stopped working with the Lets Encrypt integration and I don't know why. Just got a 404 when trying to check the .well-known endpoint. Also I don't know how to debug this. So I guess just disable and try to fix later?
2023-10-27CI script improvementsBen Sima
Added BILD_ARGS and removed the unused 'while read' so you can just call it directly without having to supply arguments.
2023-10-27Use nvidia GPU for graphicsBen Sima
Even though I have 64 cpus, when I use them all for compilation, the UI still lags, so that's annoying. Until I start using this for inference full-time, offload the UI stuff to the GPU.
2023-10-27Configure clight on BerylliumBen Sima
Just for my daily usage.
2023-10-27Add my GPG-derived SSH keyBen Sima
I'd much rather use GPG for key infrastructure. I'm not ready yet to fully switch over all of these keys, but this works well so far in the gitolite-admin repo so I'll test it out for a while before removing the old keys.
2023-10-27Disallow search engines from indexing my codeBen Sima
I don't really want my code to be discoverable, I only want people looking at it if I have explicitly told them about it. I tested it like so: ϟ curl -v https://simatime.com/git/ 2>&1 | rg x-robots < x-robots-tag: noindex, follow
2023-10-27Allow all git config keys in gitoliteBen Sima
The gitolite documentation is a bit of a labyrinth, but this should allow me to set 'gitweb.description' and whatever other git-config settings in the gitolite.conf file directly. I'm also disabling gerrit, because I'm not using it and the service fails to startup for some reason. Some relevant gitolite docs: - https://gitolite.com/gitolite/gitweb-daemon.html#gitweb - https://gitolite.com/gitolite/conf.html - https://gitolite.com/gitolite/git-config
2023-10-27Rename 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-10-10Add git-branchlessBen Sima
After using this for a while, I've decided that git-branchless will be the default tool for doing trunk-based development in the omnirepo.
2023-10-10Add beryllium and connect via VPNBen Sima
I finally got everything setup for the new dev machine, but I ran into a networking problem: I can't tell my home router to expose the ssh port 22 to multiple hosts. I could have made beryllium use a different port, but instead I decided to use tailscale, and this seems to work well. I still don't have hostname routing working, but maybe that's a simple config in tailscale somewhere. Eventually I will get all intra-networking stuff to use a vpn, but for now just using it for beryllium is fine.