Hosting on NixOS
description: Running NixOS on Linode VPS for services like Jekyll, Mastodon and Nextcloud.
Installing on Linode
I've been using Linode for a while and I used this article to install NixOS on a Linode. Now I was using one large server (2GB plan) to host everything but I thought that splitting them up would be better so I just cloned my server onto another Linode using their great webUI!
Two is better than one
Now that I have two servers I needed names for them, I've never been good with hostnames but I'm not using Mass Effect (Andromeda) characters for my systems. Mass Effect characters are for x86_64 systems and Andromeda characters for ARM64 devices. The two servers themselves are names after Reapers so sovereign and harbinger!
Hydra
The hardest part of starting for me was understanding DNS and HTTPS setup, this included using Nginx to reverse proxy a locally running service like Hydra. I was able to get this working with this configuration this allows it to be viewed from the subdomain of hydra on ahoneybun.net (it is currently off as I was just testing).
When I first tried setting Hydra up I was using the default settings for using a Nginx reverse proxy but it was not loading CSS and JavaScript, after hours of going though GitHub and Reddit I found this option which was the key:
recommendedProxySettings = true;
Once that was added and I rebuilt nixos-rebuild
everything worked as it should have!
Jekyll
For a long time this site has been on GitHub pages but I wanted to change that (partly as I was having issues with how GitHub handles DNS) and this is the first blog post since that happened and now you're on a site hosted on NixOS! Getting Jekyll to build with my site took a while but these commands was able to build with my plugins:
I created a nix-shell file (in the repository) so that I can run these commands (from the root directory) to update the site once I make a change on GitHub:
Mastodon
Setting up Mastodon on NixOS was just using this wiki page and then rebuild. One issue with my configuration is that I don't have SMTP working so confirmation emails are not sent out. To workaround this I can confirm the account using tootctl
on the server itself like this:
# Switch to root
# Switch to mastodon account
## Approve accounts though tootctl
## Accept email address though tootctl
Nix Files
You can find all of my nix files here.