mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-24 14:41:17 +00:00
acbb74ed18
Documize is an open-source alternative for wiki software like Confluence based on Go and EmberJS. This patch adds the sources for the community edition[1], for commercial their paid-plan[2] needs to be used. For commercial use a derivation that bundles the commercial package and contains a `$out/bin/documize` can be passed to `services.documize.enable`. The package compiles the Go sources, the build process also bundles the pre-built frontend from `gui/public` into the binary. The NixOS module generates a simple `systemd` unit which starts the service as a dynamic user, database and a reverse proxy won't be configured. [1] https://www.documize.com/get-started/ [2] https://www.documize.com/pricing/
68 lines
1.5 KiB
Nix
68 lines
1.5 KiB
Nix
{ pkgs, lib, config, ... }:
|
|
|
|
with lib;
|
|
|
|
let
|
|
|
|
cfg = config.services.documize;
|
|
|
|
in
|
|
|
|
{
|
|
options.services.documize = {
|
|
enable = mkEnableOption "Documize Wiki";
|
|
|
|
offline = mkEnableOption "Documize offline mode";
|
|
|
|
package = mkOption {
|
|
default = pkgs.documize-community;
|
|
type = types.package;
|
|
description = ''
|
|
Which package to use for documize.
|
|
'';
|
|
};
|
|
|
|
db = mkOption {
|
|
type = types.str;
|
|
example = "host=localhost port=5432 sslmode=disable user=admin password=secret dbname=documize";
|
|
description = ''
|
|
The DB connection string to use for the database.
|
|
'';
|
|
};
|
|
|
|
dbtype = mkOption {
|
|
type = types.enum [ "postgresql" "percona" "mariadb" "mysql" ];
|
|
description = ''
|
|
Which database to use for storage.
|
|
'';
|
|
};
|
|
|
|
port = mkOption {
|
|
type = types.port;
|
|
example = 3000;
|
|
description = ''
|
|
Which TCP port to serve.
|
|
'';
|
|
};
|
|
};
|
|
|
|
config = mkIf cfg.enable {
|
|
systemd.services.documize-server = {
|
|
wantedBy = [ "multi-user.target" ];
|
|
|
|
script = ''
|
|
${cfg.package}/bin/documize \
|
|
-db "${cfg.db}" \
|
|
-dbtype ${cfg.dbtype} \
|
|
-port ${toString cfg.port} \
|
|
-offline ${if cfg.offline then "1" else "0"}
|
|
'';
|
|
|
|
serviceConfig = {
|
|
Restart = "always";
|
|
DynamicUser = "yes";
|
|
};
|
|
};
|
|
};
|
|
}
|