@destructatron@tommorris Thanks for the offer. I more wanted to evaluate it as a basis for the deployment of Small Web servers so I was trying to grok how it worked and there’s a huge learning curve. I was just trying to get a taste for it to see if it would be right to base this system I’m building on but it feels a bit too much like Arch Linux in its culture (at least from the outside) and I’m just not smart enough for such things :)
@aral@tommorris I use Nix as a server, and deploying web servers is actually very easy and so is automatic SSL cert generation with lets encrypt. A few lines in configuration.nix, and it just, works. Virtual hosts, reverse proxies, PHP, and all that aren't too hard to configure. I can paste in the nginx block from my config if you'd like to take a look.
@aral@tommorris security.acme.acceptTerms = true; security.acme.defaults.email = "email goes here"; services.nginx = { enable = true; virtualHosts = { "destructatron.net" = { forceSSL = true; enableACME = true; locations."/" = { root = "/sites/main"; }; }; "code.destructatron.net" = { forceSSL = true; enableACME = true; locations."/" = { root = "/sites/code"; }; }; }; }; You can do certs via certbot, but the module is experimental and acme is the recommended option. We have 2 virtual hosts defined here, my main site and the code subdomain. The location is set to /, so where browsers go for index.html. The root is the absolute path to where the site's files are. The braces define blocks. If we didn't have these, we'd be doing services.nginx.virtualHosts.domain.locations.root for example, which is kind of annoying to keep writing out.
@scott@destructatron@tommorris Thank you. And yes, this is very much along the lines of what I’d need to do. I actually think, for my needs, something like CoreOS set to auto-update might be better. But good luck finding inexpensive and reliable VPS hosting for either :)
@aral@mastodon.ar.al@destructatron@masto.destructatron.net@tommorris@mastodon.social i have to say, the learning curve for the sort of approach you're talking about is somewhat steep. You're not just having to configure NixOS as a system, but to get the real advantage of it you'd want to package your software for Nix first, and have them be configurable through user's NixOS configs like services.kitten.enable = true; ect.
I found these tutorials to really clear things up when it comes to packaging for Nix:
@destructatron@scott@tommorris Nice. Do you know off the top of your head how much overhead that added to the server setup process. Currently, it takes me about 30 seconds to set up a new server and I really want to keep it close to that :)
@scott@aral@tommorris I was gonna mention Hetzner actually. I used the nixos-infect method, just seemed easier than working out how to SSH into the iso. Added my public key to the root user, ran the script, and done.
@aral@scott@tommorris Probably took about 10 to 15 seconds, mainly because apt was being slow apt. Other distros are supported though, there's a comprehensive list on the nixos-infect page. Plus the fact that you can add a cloud init file to automate the nixos-infect procedure, is even nicer.