diff options
author | Jörg Thalheim <Mic92@users.noreply.github.com> | 2018-04-10 09:08:50 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-10 09:08:50 +0100 |
commit | d8647f96bd2caafa493733ab183342d31bc0bec6 (patch) | |
tree | 6625f272db634e0f23cb697ffe19ceb7633945f4 /nixos | |
parent | daa17416c6cdd7b3879e75cb884085cee3797a91 (diff) | |
parent | 615fefb3a5559f2acbd6b2e6dd356cd569d70d2d (diff) | |
download | nixpkgs-d8647f96bd2caafa493733ab183342d31bc0bec6.tar nixpkgs-d8647f96bd2caafa493733ab183342d31bc0bec6.tar.gz nixpkgs-d8647f96bd2caafa493733ab183342d31bc0bec6.tar.bz2 nixpkgs-d8647f96bd2caafa493733ab183342d31bc0bec6.tar.lz nixpkgs-d8647f96bd2caafa493733ab183342d31bc0bec6.tar.xz nixpkgs-d8647f96bd2caafa493733ab183342d31bc0bec6.tar.zst nixpkgs-d8647f96bd2caafa493733ab183342d31bc0bec6.zip |
Merge pull request #38643 from brainrape/prosody-add-dataDir
nixos/prosody: add dataDir option
Diffstat (limited to 'nixos')
-rw-r--r-- | nixos/modules/services/networking/prosody.nix | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/nixos/modules/services/networking/prosody.nix b/nixos/modules/services/networking/prosody.nix index d57ebb61f63..f409962816d 100644 --- a/nixos/modules/services/networking/prosody.nix +++ b/nixos/modules/services/networking/prosody.nix @@ -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"; }; }; |