Merge pull request #58398 from Ma27/package-documize
documize-community: init at 2.2.1
This commit is contained in:
67
nixos/modules/services/web-apps/documize.nix
Normal file
67
nixos/modules/services/web-apps/documize.nix
Normal file
@@ -0,0 +1,67 @@
|
||||
{ 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";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user