charybdis service: add option to configure MOTD (#25512)

Read MOTD files from /etc/charybdis.
This commit is contained in:
Sebastian Hagen 2017-05-25 22:28:50 +01:00 committed by Franz Pletz
parent dd2b1744ba
commit b3b2431932
2 changed files with 46 additions and 31 deletions

View File

@ -51,6 +51,17 @@ in
'';
};
motd = mkOption {
type = types.nullOr types.lines;
default = null;
description = ''
Charybdis MOTD text.
Charybdis will read its MOTD from /etc/charybdis/ircd.motd .
If set, the value of this option will be written to this path.
'';
};
};
};
@ -58,8 +69,8 @@ in
###### implementation
config = mkIf cfg.enable {
config = mkIf cfg.enable (lib.mkMerge [
{
users.extraUsers = singleton {
name = cfg.user;
description = "Charybdis IRC daemon user";
@ -88,9 +99,12 @@ in
${coreutils}/bin/mkdir -p ${cfg.statedir}
${coreutils}/bin/chown ${cfg.user}:${cfg.group} ${cfg.statedir}
'';
};
};
}
(mkIf (cfg.motd != null) {
environment.etc."charybdis/ircd.motd".text = cfg.motd;
})
]);
}

View File

@ -19,6 +19,7 @@ stdenv.mkDerivation rec {
"--enable-ipv6"
"--enable-openssl=${openssl.dev}"
"--with-program-prefix=charybdis-"
"--sysconfdir=/etc/charybdis"
];
buildInputs = [ bison flex openssl ];