Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add wiki-js recipe #815

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions source/guides/recipes/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ sharing-dependencies.md
Automatic environments <direnv>
dependency-management.md
Python development environment <./python-environment.md>
Setup Wiki-JS on NixOS <./wiki-js.md>
```
52 changes: 52 additions & 0 deletions source/guides/recipes/wiki-js.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
(setup-wiki-js)=
# Setup wiki.js

[Wiki.js](https://js.wiki/) is a modern, open-source wiki engine running on Node.js and written in JavaScript. It offers a sleek and user-friendly platform for managing and sharing knowledge.

To quickly set up an instance of Wiki.js on your local NixOS machine, a database service is required, and optionally a reverse proxy for HTTPS URLs.

Below is a streamlined and ready-to-use recipe to spawn this service on your server:

```nix
{ pkgs
, config
, ...
}:

{
services.postgresql = {
enable = true;
ensureDatabases = [ "wikijs" ];
authentication = pkgs.lib.mkOverride 10 ''
#type database DBuser auth-method
local all all trust
'';
ensureUsers = [
{
name = "wikijs";
ensureDBOwnership = true;
}
];
};

services.wiki-js = {
enable = true;
settings = {
bindIp = "127.0.0.1";
port = 3000;

db = {
db = "wikijs";
user = "wikijs";
host = "/run/postgresql";
};
};
};

# Replace `wiki.router.lan` with your own domain name
services.caddy.virtualHosts."wiki.router.lan".extraConfig = ''
tls internal
reverse_proxy http://127.0.0.1:3000
'';
}
```
Loading