Git + NixOS = <3
this post is still WIP -- I don't have access to the servers which I made this setup anymore, so documentation is mostly based off my memory, which isn't great.
Setting up servers can be bothersome and maintaining and installing new software can be a huge timesink. In this post I will go through how I combined gitolite with nixos to make it easier to maintain and transfer servers. easier in my opinion. This method allows someone to manage this with a simple git repository containing the Nix configuration file, when pushed it should automatically update and apply the new configuration to the server. It's a lot like a CI/CD pipeline, or infrastructure as code, but with limited setup and resources -- a poor mans IAC.
For the setup we will use
- NixOS, a linux distribution that supports a declarative style of configuration. This configuration language is how the whole thing is set up.
- Gitolite allows you to setup git hosting with fine-grained access control over git repositories. It also allows us to install server-side hooks which we'll use to update the NixOS hosts' configuration.
- Docker, a container platform that will allow us to host our services on our host.
You do not need to setup gitolite on all maintained servers, but automating the process this way requires gitolite installed somewhere.
Setup
First off, you need a server with a fresh installation of NixOS available.
The remainder of this post is not finished.