This repository manages a website for learning about and trying the amazing Project:M36 database system, built by @agentm.
This setup uses the powerful Nix package management system and its accompanying toolset:
Note: Nix does not support Windows. If you're on Windows, you'll need to run this from within a Virtual Machine (VM).
With this setup, you can easily deploy your site to one or more servers with minimal effort. You can (and should) also deploy to local VirtualBox virtual machines. And, you can even use the Nix packages to install the site directly on your local host.
-
First install Nix. It is not invasive and can be removed easily if you change your mind (using
rm -r /nix). -
Deployments are done with NixOps. You can install
nixopswithnixby runningnix-env -i nixops. However, you don't need to because this repository has adeploy/managescript that you'll use which will runnixopstasks for you. -
Install VirtualBox in order to test your server deployments.
-
If you plan to deploy to a real server, you will likely need to keep secrets in this repository. That will require installing git-crypt and setting it up. See
SETUP-SECRETS.mdfor information on that.
Create a VirtualBox deployment:
deploy/manage vbox create '<server/logical.vbox.nix>' '<server/physical.vbox.nix>'deploy/manage vbox deploy
Notes:
nixopsdeployments can sometimes be finicky. If something hangs or fails, try running it again. It is a very deterministic system so this should not be a problem.- Run
deploy/manage --helpto see all options (this is justnixopsunderneath).
You should then be able to open the IP of the VM in your browser and test it. If you don't know the IP, run deploy/manage vbox info.
- Sometimes VirtualBox will give your machine a new IP. If this happens,
nixops(i.e. themanagescript) may fail to connect to your machine via SSH. If this happens, remove the line with the old IP from your~/.ssh/known_hostsfile and try again. - If the state of your VirtualBox VM changes in a way that
nixopsdidn't notice, your deployments may fail. Try running./manage vbox deploy --check(using the--checkflag) to tellnixopsto reassess the state of the machine.
With this setup you can deploy to any PaaS/IaaS service supported by nixops. This project uses DigitalOcean. See DEPLOY-DIGITAL-OCEAN.md for details.