charybdis service: add option to configure MOTD (#25512)
Read MOTD files from /etc/charybdis.
This commit is contained in:
parent
dd2b1744ba
commit
b3b2431932
@ -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;
|
||||
})
|
||||
]);
|
||||
}
|
||||
|
@ -19,6 +19,7 @@ stdenv.mkDerivation rec {
|
||||
"--enable-ipv6"
|
||||
"--enable-openssl=${openssl.dev}"
|
||||
"--with-program-prefix=charybdis-"
|
||||
"--sysconfdir=/etc/charybdis"
|
||||
];
|
||||
|
||||
buildInputs = [ bison flex openssl ];
|
||||
|
Loading…
Reference in New Issue
Block a user