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.
- kotatsuyaki ( @kotatsuyaki@beehaw.org ) 1•1 year ago
There is a NixOS module for Lemmy, and it’s usage is documented in the NixOS manual. To quote the minimal example from the manual:
services.lemmy = { enable = true; settings = { hostname = "lemmy.union.rocks"; database.createLocally = true; }; caddy.enable = true; }
- kotatsuyaki ( @kotatsuyaki@beehaw.org ) 1•1 year ago
I just saw that you’re asking for kbin, not lemmy. The steps probably wouldn’t work as-is, and the “correct” way is to create a NixOS module for kbin. Some of the configuration steps (e.g. creating the
kbin
service user, configuring PHP, configuring Nginx, configuring Let’s Encrypt etc.) are supported by NixOS modules in nixpkgs. It’s also necessary to packagekbin
itself, and to create systemd services to run it.Creating a module requires effort, though, and I’d rather use a container to deploy it for simplicity, if it were me.
- Atemu ( @Atemu@lemmy.ml ) 1•1 year ago
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.
- Matej ( @matejc@matejc.com ) English1•1 year ago
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.
- eneff ( @eneff@discuss.tchncs.de ) English1•1 year ago