mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-05-16 15:01:06 +00:00
nixos/prosody: add dataDir option
This commit is contained in:
parent
3458776bb1
commit
615fefb3a5
1 changed files with 10 additions and 4 deletions
|
@ -295,6 +295,12 @@ in
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
dataDir = mkOption {
|
||||||
|
type = types.string;
|
||||||
|
description = "Directory where Prosody stores its data";
|
||||||
|
default = "/var/lib/prosody";
|
||||||
|
};
|
||||||
|
|
||||||
allowRegistration = mkOption {
|
allowRegistration = mkOption {
|
||||||
type = types.bool;
|
type = types.bool;
|
||||||
default = false;
|
default = false;
|
||||||
|
@ -421,11 +427,11 @@ in
|
||||||
|
|
||||||
environment.etc."prosody/prosody.cfg.lua".text = ''
|
environment.etc."prosody/prosody.cfg.lua".text = ''
|
||||||
|
|
||||||
pidfile = "/var/lib/prosody/prosody.pid"
|
pidfile = "${cfg.dataDir}/prosody.pid"
|
||||||
|
|
||||||
log = "*syslog"
|
log = "*syslog"
|
||||||
|
|
||||||
data_path = "/var/lib/prosody"
|
data_path = "${cfg.dataDir}"
|
||||||
plugin_paths = {
|
plugin_paths = {
|
||||||
${lib.concatStringsSep ", " (map (n: "\"${n}\"") cfg.extraPluginPaths) }
|
${lib.concatStringsSep ", " (map (n: "\"${n}\"") cfg.extraPluginPaths) }
|
||||||
}
|
}
|
||||||
|
@ -474,7 +480,7 @@ in
|
||||||
description = "Prosody user";
|
description = "Prosody user";
|
||||||
createHome = true;
|
createHome = true;
|
||||||
group = "prosody";
|
group = "prosody";
|
||||||
home = "/var/lib/prosody";
|
home = "${cfg.dataDir}";
|
||||||
};
|
};
|
||||||
|
|
||||||
users.extraGroups.prosody = {
|
users.extraGroups.prosody = {
|
||||||
|
@ -490,7 +496,7 @@ in
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
User = "prosody";
|
User = "prosody";
|
||||||
Type = "forking";
|
Type = "forking";
|
||||||
PIDFile = "/var/lib/prosody/prosody.pid";
|
PIDFile = "${cfg.dataDir}/prosody.pid";
|
||||||
ExecStart = "${cfg.package}/bin/prosodyctl start";
|
ExecStart = "${cfg.package}/bin/prosodyctl start";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Reference in a new issue