Simplified flashing (but only for Linux with Nix)

Following the directions to flash the Model 01 wasn’t too bad relatively speaking, but it’s got a few things that are a bit annoying. You have to have the Arduino build tool chain. There’s two repositories (Kaleidoscope and Model01). Each has submodules. If you don’t set magic environment variables, the Kaleidoscope project is expected to be installed in specific directories.

I don’t need a GUI configurator (though I’m sure that would be greatly appreciated by other users). All I wanted was a more streamlined automation, but one that was more reliable.

So I made a little project to do exactly that, using the Nix package manager. It turned out how I’d hoped it would. But unfortunately, it only works on Linux (not Windows or Mac).

I spent more time than I’d like to admit polishing it this weekend, so I thought I’d share it in a few places. Maybe you can use it. Or maybe you have some feedback about it.

Here’s the link: https://github.com/shajra/shajra-keyboards

4 Likes

Nice work.
I took a stab at writing nix expression for my config. You can find the result here [1].

Compared to your solution I build hex with nix-build release.nix and use the result of that derivation to flash using avrdude. I wanted to put flash.sh in the nix store but that would mean depending on the output of the operation in the toFile.

I am also copying udev rules so perhaps one could add this keymap to services.udev in their nix config, but I didn’t tried that one

[1] https://git.sr.ht/~madnat/madkeys

3 Likes

Thanks for this! I tried to get shajra’s repo working, which is also very nice, but a bit more complicated so I couldn’t immediately figure out what was going wrong as I was trying it. I managed to get your config working immediately. Bonus points for easily allowing 3rd party plugins! This is such a good example of how nix can make software in general so much easier to use.

I just switched distro and wanted to change some bindings and the thought of setting up the whole dev chain again was filling me with dread. Searched for “nix keyboardio” and what do you know.

Hey you’re even using my Digital Rain effect :slight_smile:

A few comments and suggestions:

I got warnings after copying/pasting your udev rules for M01 and M100. := should be =.

I didn’t find the documentation about -k vs -K very clear, but what I did was add bjn directories alongside your shajra ones and I’m using -k bjn; I think that’s right.

I got stuck then after running the binary… I’ll post an issue on the github repo.

(Edit: I got it working in the end! Opened a few pull requests on the repo with the changes I had to make.)