···58 };
59 };
6061+ motd = mkOption {
62+ type = types.nullOr types.str;
63+ default = null;
64+ description = ''
65+ Message of the day
66+67+ The contents are shown as-is; eg. you will want to add a newline if
68+ setting a non-empty message since the knot won't do this for you.
69+ '';
70+ };
71+72+ motdFile = mkOption {
73+ type = types.nullOr types.path;
74+ default = null;
75+ description = ''
76+ File containing message of the day
77+78+ The contents are shown as-is; eg. you will want to add a newline if
79+ setting a non-empty message since the knot won't do this for you.
80+ '';
81+ };
82+83 server = {
84 listenAddr = mkOption {
85 type = types.str;
···126 cfg.package
127 ];
128129+ system.activationScripts.gitConfig = let
130+ setMotd =
131+ if cfg.motdFile != null && cfg.motd != null then
132+ throw "motdFile and motd cannot be both set"
133+ else ''
134+ ${optionalString (cfg.motdFile != null) "cat ${cfg.motdFile} > ${cfg.stateDir}/motd"}
135+ ${optionalString (cfg.motd != null) ''printf "${cfg.motd}" > ${cfg.stateDir}/motd''}
136+ '';
137+ in ''
138 mkdir -p "${cfg.repo.scanPath}"
139 chown -R ${cfg.gitUser}:${cfg.gitUser} "${cfg.repo.scanPath}"
140···146 [receive]
147 advertisePushOptions = true
148 EOF
149+ ${setMotd}
150 chown -R ${cfg.gitUser}:${cfg.gitUser} "${cfg.stateDir}"
151 '';
152