summaryrefslogtreecommitdiffstats
path: root/nixos/modules
diff options
context:
space:
mode:
authorChristoph Heiss <christoph@c8h4.io>2023-04-21 01:13:42 +0200
committerChristoph Heiss <christoph@c8h4.io>2023-11-11 13:01:45 +0100
commit6648488333f66dd8fee678f27fb33016b046090f (patch)
tree6014d2193f9753ef64f45bf9a72dc31de2b0c954 /nixos/modules
parent6e51802196d4b3f60e65b061c637d90cbc5fceb8 (diff)
sourcehut: fix logging of git/hg ssh commands
Signed-off-by: Christoph Heiss <christoph@c8h4.io>
Diffstat (limited to 'nixos/modules')
-rw-r--r--nixos/modules/services/misc/sourcehut/default.nix17
1 files changed, 13 insertions, 4 deletions
diff --git a/nixos/modules/services/misc/sourcehut/default.nix b/nixos/modules/services/misc/sourcehut/default.nix
index 9774917407e4..6e1347a52d6f 100644
--- a/nixos/modules/services/misc/sourcehut/default.nix
+++ b/nixos/modules/services/misc/sourcehut/default.nix
@@ -801,11 +801,20 @@ in
'';
};
systemd.services.sshd = {
- #path = optional cfg.git.enable [ cfg.git.package ];
+ preStart = concatStringsSep "\n" (
+ optionals cfg.git.enable (map (n: ''
+ touch /var/log/sourcehut/gitsrht-${n} # create if it does not exist yet
+ chown --silent ${cfg.git.user}:${cfg.git.group} /var/log/sourcehut/gitsrht-${n} || true
+ '') [
+ "keys"
+ "shell"
+ "update-hook"
+ ]) ++
+ optional cfg.hg.enable [
+ "chown ${cfg.hg.user}:${cfg.hg.group} /var/log/sourcehut/hgsrht-keys"
+ ]);
serviceConfig = {
- BindPaths = optionals cfg.git.enable [
- "/var/log:/var/log"
- ];
+ LogsDirectory = mkIf (cfg.git.enable || cfg.hg.enable) "sourcehut";
BindReadOnlyPaths =
# Note that those /usr/bin/* paths are hardcoded in multiple places in *.sr.ht,
# for instance to get the user from the [git.sr.ht::dispatch] settings.