wiki
wiki copied to clipboard
Configuration using nixos modules
Hi,
A week ago I was discussing with @fadenb, with regards to #7, where he tried the theme for a couple of minutes on the live wiki. After the discussion, I searched for a method to keep the wiki configuration under nix/nixos, which would also keep the mediawiki code, skins, extensions, etc all tracked under nix.
I have looked at <nixpkgs>
and found that there is a mechanism available to keep mediawiki's files entirely tracked with nix. The only issue, if it is one, with that system is that it is apache-only. I have now been using it to make and keep track of all changes needed for this setup to work. It all seems to work properly.
From a quick glance to how it works, it shouldn't be that hard to port in a way that would make it work with nginx. That is, if it is needed to use nginx for this. I believe the harder part would be to do so in a way that makes the module work for both servers, and then, I wouldn't be surprised if it was easier than expected.
Here's an example of a working configuration:
- https://gitlab.com/samueldr/nixos-wiki-proposition
Advantages
- Well, declarativeness is awesome!
- It appears to handle migrations!
- Some commands are more easily reachable through aliases
- The base system behind all that is part of a test for nixos releases.
Inconvenients
- Might not be as fresh as possible. The current mediawiki release used is 1.27, whilst 1.29 is available.
- Might not be as thoroughly tested
- Not at all documented officially
- A bit clunky right now
I am 100% for this. Declarative is the only way forward! Regarding migration from apache to nginx, i think it will not be too difficult to do, i will check it out next week. @Lassulus did the same kind of migration the last time for owncloud/nextcloud wink wink
🎆 I have updated my repository, with what I believe is a complete packaging of what's in use in the wiki.
The configuration is incomplete, since we don't have the current configuration, but it should work. At least, it works on my machine™.
There is one niggle with what I did: it's all a big hack, but this is a POC, it all can work. The packages are all described at the top of the configuration file. It might be better to actually upstream all extensions and themes as pkgs
available in nixpkgs
, right?
There is a git diff
file for nixpkgs, updating mediawiki and adding extensions support to the module. This should be upstreamed.
just send a pull request regarding the mediawiki changes in nixpkgs. Changes looks good to me.
Oh, uhm, I tried to, looks like somebody beat me to the punch for the extensions support. Months ago. This'll teach me to use the latest stable release.