···
cfg = config.services.gollum;
+
(lib.mkRemovedOptionModule
···
options.services.gollum = {
+
enable = lib.mkEnableOption "Gollum, a git-powered wiki service";
+
address = lib.mkOption {
description = "IP address on which the web server will listen.";
description = "Port on which the web server will run.";
+
extraConfig = lib.mkOption {
+
type = lib.types.lines;
description = "Content of the configuration file";
description = "Enable support for math rendering using KaTeX";
+
allowUploads = lib.mkOption {
+
type = lib.types.nullOr (
···
description = "Enable uploads of external files";
+
user-icons = lib.mkOption {
+
type = lib.types.nullOr (
···
description = "Enable specific user icons for history view";
description = "Parse and interpret emoji tags";
+
h1-title = lib.mkOption {
description = "Use the first h1 as page title";
+
no-edit = lib.mkOption {
description = "Disable editing pages";
+
local-time = lib.mkOption {
description = "Use the browser's local timezone instead of the server's for displaying dates.";
+
branch = lib.mkOption {
description = "Git branch to serve";
+
stateDir = lib.mkOption {
default = "/var/lib/gollum";
description = "Specifies the path of the repository directory. If it does not exist, Gollum will create it on startup.";
+
package = lib.mkPackageOption pkgs "gollum" { };
description = "Specifies the owner of the wiki directory";
description = "Specifies the owner group of the wiki directory";
+
config = lib.mkIf cfg.enable {
+
users.users.gollum = lib.mkIf (cfg.user == "gollum") {
description = "Gollum user";
···
--config ${pkgs.writeText "gollum-config.rb" cfg.extraConfig} \
+
${lib.optionalString cfg.math "--math"} \
+
${lib.optionalString cfg.emoji "--emoji"} \
+
${lib.optionalString cfg.h1-title "--h1-title"} \
+
${lib.optionalString cfg.no-edit "--no-edit"} \
+
${lib.optionalString cfg.local-time "--local-time"} \
+
${lib.optionalString (cfg.allowUploads != null) "--allow-uploads ${cfg.allowUploads}"} \
+
${lib.optionalString (cfg.user-icons != null) "--user-icons ${cfg.user-icons}"} \