Today's plan

Think I'll keep my focus around Python and Nix. I'll try to get a NixOS module ready for RhodeCode, this would make a full example of a Python application with NixOS integration I guess. And it's useful for myself 😇.

If time permits, then I will try to push out another use case which I do have, it's around Tryton and it comes with it's own peculiarities since a typical installation needs a custom set of modules (Python packages).

Things which did happen

Remote building

When I wanted to check if the latest work in nix-rhodecode and pip2nix-generated does also build on NixOS, I got into some struggles to revive remote building on my macbook.

So I took the opportunity to write a small note to myself about remote building.

nix-rhodecode

Before working on a module for NixOS I did double check if the derivations actually build on NixOS. This did lead to a few tweaks needed, mainly around the IPython package. It does have a dependency on appnope which is only needed on macOS.

This small issue guided me to discover the function lib.remove inside of Nixpkgs, it allows to remove an element from a list and is very useful for this case. I did post a small note about lib.remove in a different post.

pip2nix-generated

When trying out remote building for the examples in pip2nix-generated I did add a stub buildPhase as an interim step, so that a call to nix-build would actually work.

This is not very useful though, so I am thinking of using one of the functions to build an environment to produce a more useful build result for these setups.

Post-Hackathon

Thanks to a long train trip back home I was able to keep working on a few bits and got the following things as "extras" done.

NixOS module for RhodeCode Enterprise CE

During the train trip I managed to get a basic version of a NixOS module for RhodeCode Enterprise into shape. The result consists actually of two pieces: First a module for the VCSServer. That's a component for the abstraction of the version control systems. The second part is enterprise itself. Both of them are Pyramid based web applications.

The code is available in the folder nixos inside of the repository nix-rhodecode.

Building a NixOS container on macOS

To test my new shiny module I came up with the idea that I could just build a container with the module. It turns out that this is actually quite easy to achieve. Details are written in a separate post about building NixOS containers on macOS.

It's only of limited usefulness. I found that for proper testing a combination of NixOPS and it's container backend was very useful. This way I was able to use a cycle of nixops destroy -d testdeployment and nixops deploy -d testdeployment to test out the module.

The test configurations are also available in the repository nix-rhodecode.

NixOPS tweaks

During my experiments I did notice that the deployment keys concept does not work when using the container backend.

I assume that I found the reason and got a small pull request sent out: https://github.com/NixOS/nixops/pull/759

There are more tweak in my fork, which might be needed for remote building on macOS. If you run into issues, give the branch work-johbo in my fork of nixops.

Conclusions

Quite happy that I got a few bits put together and this time I did manage to push them out on time so that there is no risk of myself not having the time to follow up and publish things.

For most things I tried to make them available in my Github in a way so that it is easy to try those things out. I hope that's useful for others to get a feeling of my approaches, so that it is easier to judge them based on a real impression instead of just slides.


Comments

comments powered by Disqus