NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
18.13k stars 14.16k forks source link

Mastodon #24600

Closed chris-martin closed 6 years ago

chris-martin commented 7 years ago

There's a lot of talk on Mastodon about wanting more people to run servers. The current recommended deploy environment is Docker. It'd be nice if we could provide NixOS support. I've already seen several of y'all on Mastodon, so we ought to be able to get this done :smiley: I may work on this myself if I find time.

Profpatsch commented 7 years ago

Any update?

chris-martin commented 7 years ago

Not from me, I've been spending all my time shooting the shit on Mastodon.

fpletz commented 7 years ago

It's on my immediate todo-list. Probably this weekend.

As it's a rails app and I've already done lots of rails nixos modules, it should be easy. If anyone wants to beat me, just look at the gitlab or frab module.

ashkitten commented 7 years ago

This would be really neat! How's it coming along?

fpletz commented 7 years ago

Unfortunately it's little bit more complicated because it needs lots of NodeJS dependencies for the frontend stuff and node2nix fails to produce working nix expressions. Also, some gems need overrides because they won't build either.

ashkitten commented 7 years ago

Ah that sucks. Let me know if there's anything I can do to help, but i'm just a newbie to NixOS really.

chris-martin commented 7 years ago

Is it feasible to half-ass the JS/Ruby dependencies by just pulling them at runtime when the server starts?

chris-martin commented 7 years ago

Just tried running node2nix 1.2.0 on Mastodon master.

error: ‘buildNodePackage’ at /home/chris/code/mastodon/node-env.nix:198:22 called without required argument ‘version’, at /home/chris/code/mastodon/node-packages.nix:16677:13

Line 16677. Wow. That seems like... a lot of output.

ghost commented 7 years ago

Where are we on this? Can I help?

paperdigits commented 7 years ago

Is there an update to this? I'd be awesome to deploy mastodon on Nix!

erictapen commented 6 years ago

I think I'm doing some progress on this. I can't reproduce the failing node2nix anymore and I managed to build the ruby environment (took some overrides as @fpletz suggested).

My progress is currently here.

I never really tested running the server yet, as there is quite a lot to do before that works. But I think, that the dependencies are almost in place.

Biggest pain point atm is the Node environment. I basically copied the approach from base-16-builder. That builds, but what bothers me is

Would be nice if someone with more NodeJS domain knowledge would look onto that.

andir commented 6 years ago

Do you know what would be required to test that using VM tests?

I was thinking of having 2 mastodon instances and maybe using API-clients to post and fetch messages?

erictapen commented 6 years ago

I never looked into NixOS VM tests, but iirc Mastodon would be well suited for that. One could test federation and client-server-communication as you described.

This would definitely depend on a working service expression. Additionally there needs to be a way to create users from the command line (I'm sure there is) and a Mastodon CLI client (there are some).

erictapen commented 6 years ago

I made the mistake to take a break in the development. In that time, Nixpkgs moved considerably as well as Mastodon. The package doesn't even build anymore.

This might be too complex for my current state of knowledge of Ruby and Node. I give up.

I rebased my progress ontop of nixos-unstable and added a minor fix. Maybe someone else has luck with it:

https://github.com/erictapen/nixpkgs/tree/mastodon

If I ever try to package a Fediverse app again, I may try Pleroma, which seems to be more leightweight.

brainrake commented 6 years ago

Can we close this until someone opens a PR? Seems to have lost momentum.

erictapen commented 6 years ago

I'd think it would make sense to close it. Haven't heard of any progress in a while.

brainrake commented 6 years ago

@chris-martin Can we close this until someone opens a PR?

chris-martin commented 6 years ago

Sounds reasonable to me.

ghost commented 5 years ago

I have an instance runnng on https://social.pbb.lc The module I wrote is available at https://git.pbb.lc/petabyteboy/nixfiles/src/branch/master/pkgs/mastodon/default.nix https://git.pbb.lc/petabyteboy/nixfiles/src/branch/master/modules/mastodon.nix It will need a few changes for nixpkgs, I will open a PR soon.

costrouc commented 5 years ago

@petabyteboy any plans to open a PR? I have plans to deploy a mastadon server via nix. I could help get this started if you would like

matthiasbeyer commented 5 years ago

Yeah please do this!

ghost commented 5 years ago

there is a PR at #60788