Deploying Phoenix on NixOS

Hey everyone, I realized I should post this here.

I put some cycles into achieving a really clean deployment process using NixOS modules and deploy-rs on a digitalOcean node.

The Nix code is here:

And a short tutorial on getting the deploy process setup.

It might not be as streamlined as Docker/Fly.io options but it’s nice, it’s cheap, and it’s Nix.

7 Likes

Thanks. I will check this out.

In another Elixir project I was using Nix, systemd and some bash scripts.
I have not tried Deploy-rs.

The module.nix definition encapsulates the systemd+bash steps.

Then deploy-rs allows you to build the whole system locally and copy it up. I found this saved me a tier on my VPS subscription, since the store size required to build is that much larger than the final product.

1 Like