mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-07-13 13:40:28 +03:00
nixos/soju: add adminSocket.enable option
This commit is contained in:
parent
4959d7bcd8
commit
5207bb723a
2 changed files with 15 additions and 1 deletions
|
@ -5,7 +5,10 @@ with lib;
|
|||
let
|
||||
cfg = config.services.soju;
|
||||
stateDir = "/var/lib/soju";
|
||||
listenCfg = concatMapStringsSep "\n" (l: "listen ${l}") cfg.listen;
|
||||
runtimeDir = "/run/soju";
|
||||
listen = cfg.listen
|
||||
++ optional cfg.adminSocket.enable "unix+admin://${runtimeDir}/admin";
|
||||
listenCfg = concatMapStringsSep "\n" (l: "listen ${l}") listen;
|
||||
tlsCfg = optionalString (cfg.tlsCertificate != null)
|
||||
"tls ${cfg.tlsCertificate} ${cfg.tlsCertificateKey}";
|
||||
logCfg = optionalString cfg.enableMessageLogging
|
||||
|
@ -68,6 +71,14 @@ in
|
|||
description = lib.mdDoc "Whether to enable message logging.";
|
||||
};
|
||||
|
||||
adminSocket.enable = mkOption {
|
||||
type = types.bool;
|
||||
default = true;
|
||||
description = lib.mdDoc ''
|
||||
Listen for admin connections from sojuctl at /run/soju/admin.
|
||||
'';
|
||||
};
|
||||
|
||||
httpOrigins = mkOption {
|
||||
type = types.listOf types.str;
|
||||
default = [];
|
||||
|
@ -119,6 +130,7 @@ in
|
|||
Restart = "always";
|
||||
ExecStart = "${cfg.package}/bin/soju -config ${configFile}";
|
||||
StateDirectory = "soju";
|
||||
RuntimeDirectory = "soju";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue