···
cfg = config.services.gollum;
16
-
(mkRemovedOptionModule
13
+
(lib.mkRemovedOptionModule
···
options.services.gollum = {
27
-
enable = mkEnableOption "Gollum, a git-powered wiki service";
24
+
enable = lib.mkEnableOption "Gollum, a git-powered wiki service";
29
-
address = mkOption {
26
+
address = lib.mkOption {
27
+
type = lib.types.str;
description = "IP address on which the web server will listen.";
32
+
port = lib.mkOption {
33
+
type = lib.types.port;
description = "Port on which the web server will run.";
41
-
extraConfig = mkOption {
38
+
extraConfig = lib.mkOption {
39
+
type = lib.types.lines;
description = "Content of the configuration file";
44
+
math = lib.mkOption {
45
+
type = lib.types.bool;
description = "Enable support for math rendering using KaTeX";
53
-
allowUploads = mkOption {
54
-
type = types.nullOr (
50
+
allowUploads = lib.mkOption {
51
+
type = lib.types.nullOr (
···
description = "Enable uploads of external files";
64
-
user-icons = mkOption {
65
-
type = types.nullOr (
61
+
user-icons = lib.mkOption {
62
+
type = lib.types.nullOr (
···
description = "Enable specific user icons for history view";
72
+
emoji = lib.mkOption {
73
+
type = lib.types.bool;
description = "Parse and interpret emoji tags";
81
-
h1-title = mkOption {
78
+
h1-title = lib.mkOption {
79
+
type = lib.types.bool;
description = "Use the first h1 as page title";
87
-
no-edit = mkOption {
84
+
no-edit = lib.mkOption {
85
+
type = lib.types.bool;
description = "Disable editing pages";
93
-
local-time = mkOption {
90
+
local-time = lib.mkOption {
91
+
type = lib.types.bool;
description = "Use the browser's local timezone instead of the server's for displaying dates.";
96
+
branch = lib.mkOption {
97
+
type = lib.types.str;
description = "Git branch to serve";
106
-
stateDir = mkOption {
103
+
stateDir = lib.mkOption {
104
+
type = lib.types.path;
default = "/var/lib/gollum";
description = "Specifies the path of the repository directory. If it does not exist, Gollum will create it on startup.";
112
-
package = mkPackageOption pkgs "gollum" { };
109
+
package = lib.mkPackageOption pkgs "gollum" { };
111
+
user = lib.mkOption {
112
+
type = lib.types.str;
description = "Specifies the owner of the wiki directory";
117
+
group = lib.mkOption {
118
+
type = lib.types.str;
description = "Specifies the owner group of the wiki directory";
127
-
config = mkIf cfg.enable {
124
+
config = lib.mkIf cfg.enable {
129
-
users.users.gollum = mkIf (cfg.user == "gollum") {
126
+
users.users.gollum = lib.mkIf (cfg.user == "gollum") {
description = "Gollum user";
···
--config ${pkgs.writeText "gollum-config.rb" cfg.extraConfig} \
161
-
${optionalString cfg.math "--math"} \
162
-
${optionalString cfg.emoji "--emoji"} \
163
-
${optionalString cfg.h1-title "--h1-title"} \
164
-
${optionalString cfg.no-edit "--no-edit"} \
165
-
${optionalString cfg.local-time "--local-time"} \
166
-
${optionalString (cfg.allowUploads != null) "--allow-uploads ${cfg.allowUploads}"} \
167
-
${optionalString (cfg.user-icons != null) "--user-icons ${cfg.user-icons}"} \
158
+
${lib.optionalString cfg.math "--math"} \
159
+
${lib.optionalString cfg.emoji "--emoji"} \
160
+
${lib.optionalString cfg.h1-title "--h1-title"} \
161
+
${lib.optionalString cfg.no-edit "--no-edit"} \
162
+
${lib.optionalString cfg.local-time "--local-time"} \
163
+
${lib.optionalString (cfg.allowUploads != null) "--allow-uploads ${cfg.allowUploads}"} \
164
+
${lib.optionalString (cfg.user-icons != null) "--user-icons ${cfg.user-icons}"} \