NodeBB
Community forum software
Declared in: projects/NodeBB/default.nix
Try the service in a VM
- 
    Install Nix
    
- Bash
 - 
  
$ apt install --yes curl git jq nix 
- Bash
 - 
  
$ apt install --yes curl git jq nix 
- Bash
 - 
  
$ pacman --sync --refresh --noconfirm curl git jq nix 
 - 
    Download a configuration file
    
# default.nix { ngipkgs ? import (fetchTarball "https://github.com/ngi-nix/ngipkgs/tarball/main") { }, }: ngipkgs.demo-vm ( { pkgs, ... }: { services.nodebb = { enable = true; enableLocalDB = true; openFirewall = true; admin = { username = "admin"; email = "admin@example.com"; # Do *NOT* do this in production! passwordFile = pkgs.writeText "nodebb-admin-password" "nodebb"; }; settings.database = "postgres"; # Do *NOT* do this in production! databasePasswordFile = pkgs.writeText "postgresql-password" "nodebb"; }; # Do *NOT* do this in production! services.postgresql.initialScript = pkgs.writeText "init-sql-script" '' CREATE ROLE nodebb LOGIN PASSWORD 'nodebb'; ''; } )
 - 
    Enable binary substituters
    
- Bash
 - 
  
$ export NIX_CONFIG='substituters = https://cache.nixos.org/ https://ngi.cachix.org/ trusted-public-keys = cache.nixos.org-1:6nchdd59x431o0gwypbmraurkbj16zpmqfgspcdshjy= ngi.cachix.org-1:n+cal72roc3qqulxihpv+tw5t42whxmmhpragkrsrow=' 
 - 
    Build and run a virtual machine
    
- Bash
 - 
  
$ nix-build ./default.nix && ./result 
- Bash
 - 
  
$ nix-build ./default.nix && ./result 
- Bash
 - 
  
$ rev=$(nix-instantiate --eval --attr sources.nixpkgs.rev https://github.com/ngi-nix/ngipkgs/archive/master.tar.gz | jq --raw-output)$ nix-shell -I nixpkgs=https://github.com/NixOS/nixpkgs/archive/$rev.tar.gz --packages nix --run "nix-build ./default.nix && ./result" 
- Bash
 - 
  
$ nix-build ./default.nix && ./result 
 - Missing Contribute usage instructions.
 
Options
services.nodebb
- 
  
  
The admin user email address.
- Type:
 string- Declared in:
 - projects/NodeBB/services/nodebb/module.nix
 
 - 
  
  
Path to a file containing the admin user's password.
- Type:
 absolute path- Declared in:
 - projects/NodeBB/services/nodebb/module.nix
 
 - 
  
  
The admin user username.
- Type:
 string- Declared in:
 - projects/NodeBB/services/nodebb/module.nix
 
 - 
  
  
Path to a file containing the database password.
- Type:
 absolute path- Declared in:
 - projects/NodeBB/services/nodebb/module.nix
 
 - 
  
  
Whether to enable NodeBB.
- Type:
 boolean- Default:
 false- Declared in:
 - projects/NodeBB/services/nodebb/module.nix
 
 - 
  
  
Whether to enable a local database for NodeBB.
- Type:
 boolean- Default:
 false- Declared in:
 - projects/NodeBB/services/nodebb/module.nix
 
 - 
  
  
The group to run NodeBB under.
- Type:
 string- Default:
 "nodebb"- Declared in:
 - projects/NodeBB/services/nodebb/module.nix
 
 - 
  
  
Whether to open ports in the firewall.
- Type:
 boolean- Default:
 false- Declared in:
 - projects/NodeBB/services/nodebb/module.nix
 
 - 
  
  
The nodebb package to use.
- Type:
 package- Default:
 pkgs.nodebb- Declared in:
 - projects/NodeBB/services/nodebb/module.nix
 
 - 
  
  
NodeBB settings that will be written to config.json.
- Type:
 open submodule of (JSON value)- Declared in:
 - projects/NodeBB/services/nodebb/module.nix
 
 - 
  
  
Database type.
- Type:
 one of "mongo", "postgres", "redis"- Default:
 "mongo"- Declared in:
 - projects/NodeBB/services/nodebb/module.nix
 
 - 
  
  
Database name.
- Type:
 string- Default:
 "nodebb"- Declared in:
 - projects/NodeBB/services/nodebb/module.nix
 
 - 
  
  
Database host address.
- Type:
 string- Default:
 "127.0.0.1"- Declared in:
 - projects/NodeBB/services/nodebb/module.nix
 
 - 
  
  
Database host port.
- Type:
 16 bit unsigned integer; between 0 and 65535 (both inclusive)- Default:
 default port of selected database- Declared in:
 - projects/NodeBB/services/nodebb/module.nix
 
 - 
  
  
Database user.
- Type:
 string- Default:
 "nodebb"- Declared in:
 - projects/NodeBB/services/nodebb/module.nix
 
 - 
  
  
The port where NodeBB is accessible.
- Type:
 16 bit unsigned integer; between 0 and 65535 (both inclusive)- Default:
 4567- Declared in:
 - projects/NodeBB/services/nodebb/module.nix
 
 - 
  
  
Database name.
- Type:
 string- Default:
 "nodebb"- Declared in:
 - projects/NodeBB/services/nodebb/module.nix
 
 - 
  
  
Database host address.
- Type:
 string- Default:
 "127.0.0.1"- Declared in:
 - projects/NodeBB/services/nodebb/module.nix
 
 - 
  
  
Database host port.
- Type:
 16 bit unsigned integer; between 0 and 65535 (both inclusive)- Default:
 default port of selected database- Declared in:
 - projects/NodeBB/services/nodebb/module.nix
 
 - 
  
  
Whether to enable TLS.
- Type:
 boolean- Default:
 false- Declared in:
 - projects/NodeBB/services/nodebb/module.nix
 
 - 
  
  
Database user.
- Type:
 string- Default:
 "nodebb"- Declared in:
 - projects/NodeBB/services/nodebb/module.nix
 
 - 
  
  
Database name.
- Type:
 signed integer- Default:
 0- Declared in:
 - projects/NodeBB/services/nodebb/module.nix
 
 - 
  
  
Database host address.
- Type:
 string- Default:
 "127.0.0.1"- Declared in:
 - projects/NodeBB/services/nodebb/module.nix
 
 - 
  
  
Database host port.
- Type:
 16 bit unsigned integer; between 0 and 65535 (both inclusive)- Default:
 default port of selected database- Declared in:
 - projects/NodeBB/services/nodebb/module.nix
 
 - 
  
  
The URL where NodeBB is accessible.
- Type:
 string- Default:
 "http://localhost:4567"- Declared in:
 - projects/NodeBB/services/nodebb/module.nix
 
 - 
  
  
The user to run NodeBB under.
- Type:
 string- Default:
 "nodebb"- Declared in:
 - projects/NodeBB/services/nodebb/module.nix
 
 
services.nodebb.admin.email
services.nodebb.admin.passwordFile
services.nodebb.admin.username
services.nodebb.databasePasswordFile
services.nodebb.enable
services.nodebb.enableLocalDB
services.nodebb.group
services.nodebb.openFirewall
services.nodebb.package
services.nodebb.settings
services.nodebb.settings.database
services.nodebb.settings.mongo.database
services.nodebb.settings.mongo.host
services.nodebb.settings.mongo.port
services.nodebb.settings.mongo.username
services.nodebb.settings.port
services.nodebb.settings.postgres.database
services.nodebb.settings.postgres.host
services.nodebb.settings.postgres.port
services.nodebb.settings.postgres.ssl
services.nodebb.settings.postgres.username
services.nodebb.settings.redis.database
services.nodebb.settings.redis.host
services.nodebb.settings.redis.port
services.nodebb.settings.url
services.nodebb.user
Examples
Enable NodeBB with postgresql
{ pkgs, ... }: { services.nodebb = { enable = true; enableLocalDB = true; openFirewall = true; admin = { username = "admin"; email = "admin@example.com"; # Do *NOT* do this in production! passwordFile = pkgs.writeText "nodebb-admin-password" "nodebb"; }; settings.database = "postgres"; # Do *NOT* do this in production! databasePasswordFile = pkgs.writeText "postgresql-password" "nodebb"; }; # Do *NOT* do this in production! services.postgresql.initialScript = pkgs.writeText "init-sql-script" '' CREATE ROLE nodebb LOGIN PASSWORD 'nodebb'; ''; }
Declared in: projects/NodeBB/services/nodebb/examples/postgresql.nix
Enable NodeBB with redis
{ config, pkgs, ... }: { services.nodebb = { enable = true; enableLocalDB = true; admin = { username = "admin"; email = "admin@example.com"; # Do *NOT* do this in production! passwordFile = pkgs.writeText "nodebb-admin-password" "nodebb"; }; settings.database = "redis"; }; services.redis.servers."nodebb" = { port = 6379; # Do *NOT* do this in production! requirePassFile = pkgs.writeText "redis-password" "nodebb"; }; }
Declared in: projects/NodeBB/services/nodebb/examples/redis.nix
This project is funded by NLnet through these subgrants:
- Commons
 - NodeBB-collections
 - Core
 - NodeBB
 
Related links: