mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-11-11 15:27:20 +03:00
Merge pull request #38643 from brainrape/prosody-add-dataDir
nixos/prosody: add dataDir option
This commit is contained in:
commit
d8647f96bd
@ -295,6 +295,12 @@ in
|
||||
'';
|
||||
};
|
||||
|
||||
dataDir = mkOption {
|
||||
type = types.string;
|
||||
description = "Directory where Prosody stores its data";
|
||||
default = "/var/lib/prosody";
|
||||
};
|
||||
|
||||
allowRegistration = mkOption {
|
||||
type = types.bool;
|
||||
default = false;
|
||||
@ -421,11 +427,11 @@ in
|
||||
|
||||
environment.etc."prosody/prosody.cfg.lua".text = ''
|
||||
|
||||
pidfile = "/var/lib/prosody/prosody.pid"
|
||||
pidfile = "${cfg.dataDir}/prosody.pid"
|
||||
|
||||
log = "*syslog"
|
||||
|
||||
data_path = "/var/lib/prosody"
|
||||
data_path = "${cfg.dataDir}"
|
||||
plugin_paths = {
|
||||
${lib.concatStringsSep ", " (map (n: "\"${n}\"") cfg.extraPluginPaths) }
|
||||
}
|
||||
@ -474,7 +480,7 @@ in
|
||||
description = "Prosody user";
|
||||
createHome = true;
|
||||
group = "prosody";
|
||||
home = "/var/lib/prosody";
|
||||
home = "${cfg.dataDir}";
|
||||
};
|
||||
|
||||
users.extraGroups.prosody = {
|
||||
@ -490,7 +496,7 @@ in
|
||||
serviceConfig = {
|
||||
User = "prosody";
|
||||
Type = "forking";
|
||||
PIDFile = "/var/lib/prosody/prosody.pid";
|
||||
PIDFile = "${cfg.dataDir}/prosody.pid";
|
||||
ExecStart = "${cfg.package}/bin/prosodyctl start";
|
||||
};
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user