···801 '';
802 };
803 systemd.services.sshd = {
804- #path = optional cfg.git.enable [ cfg.git.package ];
00000000000805 serviceConfig = {
806- BindPaths = optionals cfg.git.enable [
807- "/var/log:/var/log"
808- ];
809 BindReadOnlyPaths =
810 # Note that those /usr/bin/* paths are hardcoded in multiple places in *.sr.ht,
811 # for instance to get the user from the [git.sr.ht::dispatch] settings.
···801 '';
802 };
803 systemd.services.sshd = {
804+ preStart = concatStringsSep "\n" (
805+ optionals cfg.git.enable (map (n: ''
806+ touch /var/log/sourcehut/gitsrht-${n} # create if it does not exist yet
807+ chown --silent ${cfg.git.user}:${cfg.git.group} /var/log/sourcehut/gitsrht-${n} || true
808+ '') [
809+ "keys"
810+ "shell"
811+ "update-hook"
812+ ]) ++
813+ optional cfg.hg.enable [
814+ "chown ${cfg.hg.user}:${cfg.hg.group} /var/log/sourcehut/hgsrht-keys"
815+ ]);
816 serviceConfig = {
817+ LogsDirectory = mkIf (cfg.git.enable || cfg.hg.enable) "sourcehut";
00818 BindReadOnlyPaths =
819 # Note that those /usr/bin/* paths are hardcoded in multiple places in *.sr.ht,
820 # for instance to get the user from the [git.sr.ht::dispatch] settings.