# Discourse module for NixOS

**URL:** https://discourse.nixos.org/t/discourse-module-for-nixos/44
**Category:** Moderation
**Created:** [April 23, 2018, 10:22pm UTC](https://discourse.nixos.org/t/discourse-module-for-nixos/44 "2018-04-23T22:22:46Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![teozkr](https://discourse.nixos.org/user_avatar/discourse.nixos.org/teozkr/32/31793_2.png) [@teozkr](https://discourse.nixos.org/u/teozkr)
#### Post date: [April 23, 2018, 10:22pm UTC](https://discourse.nixos.org/t/discourse-module-for-nixos/44/1 "2018-04-23T22:22:46Z")

</div>

As Matthew Bauer (doesn’t look like he has an account here yet) mentioned on the mailing list, it would be nice to have a NixOS module for setting up Discourse forums.

I’ve got a NixOS module that I use for [my WoW guild’s forums](https://kittens.nullable.se/login) (in a failed  
attempt to get them to migrate away from Discord :/):

[https://gist.github.com/teozkr/ae017b89d4a0179ec211757aa92ff3a1](https://gist.github.com/teozkr/ae017b89d4a0179ec211757aa92ff3a1)

That said, it’s pretty hacky since Discourse uses a complicated docker-based  
setup with their own auto-updates, and stores all settings in the database.  
A proper NixOS module would probably have to break up each container,  
as well as provide something similar to Jenkins Job Builder to declaratively  
specify settings.

Another problem with my setup is the slow rebuild times: expect to spend  
10-15 minutes waiting for it to rebuild and start. Letting Nix handle this  
rebuilding would (hopefully) at least provide some sensible caching.

---

<div class="post-metadata">

### Author: ![zimbatm](https://discourse.nixos.org/user_avatar/discourse.nixos.org/zimbatm/32/4_2.png) [@zimbatm](https://discourse.nixos.org/u/zimbatm)
#### Post date: [April 23, 2018, 10:30pm UTC](https://discourse.nixos.org/t/discourse-module-for-nixos/44/2 "2018-04-23T22:30:27Z")

</div>

I agree in principle that it would be nice to have Discourse packaged with NixOS.

Gitlab is quite similar in that it’s a Rails-based project that also needs a bunch of dependencies like Nginx, Postgresql and Redis to run properly. Gitlab is distributed in nixpkgs and has been quite maintainer-heavy. Every ruby or gitlab release tends to break things as they make too many assumptions about the system and it’s packaged as one big tangle of files.

Until they see the light the more practical approach would be to run the Docker container which is well tested by their QA. Maybe it’s possible to run that image in the nixos-containers? Both services could probably still benefit from the declarative approach for the configuration files and the container setup.

---

<div class="post-metadata">

### Author: ![teozkr](https://discourse.nixos.org/user_avatar/discourse.nixos.org/teozkr/32/31793_2.png) [@teozkr](https://discourse.nixos.org/u/teozkr)
#### Post date: [April 23, 2018, 10:43pm UTC](https://discourse.nixos.org/t/discourse-module-for-nixos/44/3 "2018-04-23T22:43:27Z")

</div>

> [@zimbatm](#):
>
> Until they see the light the more practical approach would be to run the Docker container which is well tested by their QA. Maybe it’s possible to run that image in the nixos-containers? Both services could probably still benefit from the declarative approach for the configuration files and the container setup.

Oh, so `nixos-container` supports OCI images these days? That’s interesting to know.

Either way, I’m afraid Discourse would still need some tweaking to work with that, since AFAIK its auto-update process interacts directly with the host’s Docker instance.

---

<div class="post-metadata">

### Author: ![zimbatm](https://discourse.nixos.org/user_avatar/discourse.nixos.org/zimbatm/32/4_2.png) [@zimbatm](https://discourse.nixos.org/u/zimbatm)
#### Post date: [April 23, 2018, 11:17pm UTC](https://discourse.nixos.org/t/discourse-module-for-nixos/44/4 "2018-04-23T23:17:34Z")

</div>

> [@teozkr](#):
>
> Oh, so nixos-container supports OCI images these days? That’s interesting to know.

I don’t know. It assume that it would be less work to implement that than packaging Discourse.

---

<div class="post-metadata">

### Author: ![toraritte](https://discourse.nixos.org/user_avatar/discourse.nixos.org/toraritte/32/6777_2.png) [@toraritte](https://discourse.nixos.org/u/toraritte)
#### Post date: [November 22, 2020, 10:59am UTC](https://discourse.nixos.org/t/discourse-module-for-nixos/44/5 "2020-11-22T10:59:22Z")

</div>

Will have to tackle this myself as well so here’s a couple links for future reference:

- [Docker - NixOS Wiki](https://nixos.wiki/wiki/Docker)

- [Sander van der Burg's blog: On using Nix and Docker as deployment automation solutions: similarities and differences](http://sandervanderburg.blogspot.com/2020/07/on-using-nix-and-docker-as-deployment.html)

- [Deploying docker containers declaratively](https://discourse.nixos.org/t/deploying-docker-containers-declaratively/693)

---

<div class="post-metadata">

### Author: ![toraritte](https://discourse.nixos.org/user_avatar/discourse.nixos.org/toraritte/32/6777_2.png) [@toraritte](https://discourse.nixos.org/u/toraritte)
#### Post date: [July 4, 2021, 11:22am UTC](https://discourse.nixos.org/t/discourse-module-for-nixos/44/6 "2021-07-04T11:22:06Z")

</div>

Can’t edit my post above and just found a the [gitlab upgrade PR](https://github.com/NixOS/nixpkgs/pull/27159) and [a HN thread](https://news.ycombinator.com/item?id=14717852)

---

<div class="post-metadata">

### Author: ![toraritte](https://discourse.nixos.org/user_avatar/discourse.nixos.org/toraritte/32/6777_2.png) [@toraritte](https://discourse.nixos.org/u/toraritte)
#### Post date: [December 2, 2021, 10:07am UTC](https://discourse.nixos.org/t/discourse-module-for-nixos/44/7 "2021-12-02T10:07:07Z")

</div>

Apparently, this is already done, thanks!

- 2021 / 12 / 01 [Discourse NixOS module planned version packaging policy change](https://discourse.nixos.org/t/discourse-nixos-module-planned-version-packaging-policy-change/16375)
- 2022 / 03 / 04 [Request for help fixing Discourse in Nixpkgs](https://discourse.nixos.org/t/request-for-help-fixing-discourse-in-nixpkgs/18009)
