summary refs log tree commit diff
path: root/nixos/modules/services/web-apps/wiki-js.nix
diff options
context:
space:
mode:
authorMaximilian Bosch <maximilian@mbosch.me>2023-05-14 13:36:45 +0200
committerMaximilian Bosch <maximilian@mbosch.me>2023-05-14 14:25:33 +0200
commit577ffe768cd18ddfd61c5b36853532b02e613278 (patch)
tree8d6d863ae74744ad83f21f73e479ab6daead90dd /nixos/modules/services/web-apps/wiki-js.nix
parentd86df2d640910626c1048867a142cff77d5354dc (diff)
downloadnixpkgs-577ffe768cd18ddfd61c5b36853532b02e613278.tar
nixpkgs-577ffe768cd18ddfd61c5b36853532b02e613278.tar.gz
nixpkgs-577ffe768cd18ddfd61c5b36853532b02e613278.tar.bz2
nixpkgs-577ffe768cd18ddfd61c5b36853532b02e613278.tar.lz
nixpkgs-577ffe768cd18ddfd61c5b36853532b02e613278.tar.xz
nixpkgs-577ffe768cd18ddfd61c5b36853532b02e613278.tar.zst
nixpkgs-577ffe768cd18ddfd61c5b36853532b02e613278.zip
wiki-js: use nodejs18
Part of #229910.

Unfortunately this is a little hacky because upstream doesn't intend to
support it for 2.5, but only for 3.0 which isn't out yet, however nodejs-16
will get out of maintenance during the support-span of NixOS 23.05[1].

The only breaking change is that `extract-files` uses a deprecated way
of exposing modules, I went through the list of other breaking
changes in v17 and v18[2][3] and couldn't spot any usage of removed
features, also local testing didn't reveal further issues.

Unfortunately fixing that breakage turned out to be non-trivial.
Currently, `extract-files@9.0.0` is used with the problematic portions
in its `package.json`, however it's only a transitive dependency of
`@graphql-tools/url-loader` & `apollo-upload-client`. Unfortunately, the
versions of that in use require v9 and don't work with a newer version of
`extract-files` with the problem fixed[4]. Also, upgrading the
dependencies in question is not a feasible option because `graphql-tools`
was split up into multiple smaller packages in v8 and also some of the
APIs in use in `wiki.js` were dropped there[5], so this would also be
very time-consuming and non-trivial to fix.

Since this was the only issue, I decided to go down the hacky route and
patch the problem in `package.json` of `extract-files` manually during
our `patchPhase`.

[1] https://github.com/requarks/wiki/discussions/6388
[2] https://nodejs.org/en/blog/release/v17.0.0
[3] https://nodejs.org/en/blog/release/v18.0.0
[4] Upon local testing, this broke with the following error:

        Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './public/extractFiles' is not defined by "exports" in /wiki/node_modules/extract-files/package.json
[5] For instance `SchemaDirectiveVisitor` in
  `server/graph/directives/auth`.
Diffstat (limited to 'nixos/modules/services/web-apps/wiki-js.nix')
-rw-r--r--nixos/modules/services/web-apps/wiki-js.nix2
1 files changed, 1 insertions, 1 deletions
diff --git a/nixos/modules/services/web-apps/wiki-js.nix b/nixos/modules/services/web-apps/wiki-js.nix
index 22682002532..631740f51ce 100644
--- a/nixos/modules/services/web-apps/wiki-js.nix
+++ b/nixos/modules/services/web-apps/wiki-js.nix
@@ -133,7 +133,7 @@ in {
         WorkingDirectory = "/var/lib/${cfg.stateDirectoryName}";
         DynamicUser = true;
         PrivateTmp = true;
-        ExecStart = "${pkgs.nodejs_16}/bin/node ${pkgs.wiki-js}/server";
+        ExecStart = "${pkgs.nodejs_18}/bin/node ${pkgs.wiki-js}/server";
       };
     };
   };