Hello, does anyone know about how to run a kbin instance on NixOS? Will the steps on https://codeberg.org/Kbin/kbin-core/wiki#admin-guide (but replacing the apt installs with adding packages in configuration.nix) just work, or is there a better, more reproducible way?
Thanks.
EDIT: I meant a kbin instance, not lemmy.
Your title says lemmy instance and in your description you are asking for kbin instance. Which one you truly mean?
Lemmy is already packaged in nixpkgs and its options for NixOS are: https://search.nixos.org/options?channel=unstable&show=services.lemmy.enable&from=0&size=50&sort=relevance&type=packages&query=lemmy
But I do not see kbin packaged yet.
There’s actually an entry in the NixOS manual about enabling Lemmy, but it seems a little short. I would also look at the available Lemmy options and try messing around with those if it doesn’t work.
There’s also a wiki page about it, but from first glance it seems overly complicated and way more than you should need to do. If the other things don’t work you can take a look at this, but I don’t think you should need it.
You’ll probably want to write a derivation for kbin, then write a nixos module that configures a systemd service to manage kbin as a system service.
You’ve probably found it, but in the off chance you haven’t, it seems there’s an issue on the nixpkgs repo for getting kbin packaged.
Will the steps on https://codeberg.org/Kbin/kbin-core/wiki#admin-guide (but replacing the apt installs with adding packages in configuration.nix) just work
No, they will not. It’s not about having packages available, it’s about packaging it properly and configuring the system to accommodate it.
or is there a better, more reproducible way?
First you’ll need to package kbin. This might actually be rather trivial since php does not involve a real build process AFAIK? See other PHP packages for inspiration.
Next you need to set up a module that internally declares a service and configures other services such as Redis or Nginx accordingly. Again, see other PHP modules for reference.
An alternative would be to use Docker/OCI containers to run kbin.