mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-04-14 15:27:50 +00:00
nixos/sourcehut: ensure that the repos directory exists
Fixes a bug where, if the OpenSSH server starts before the first initialization of the git service, the SSH service fails to find the corresponding bind mount and terminates with a 226/NAMESPACE error.
This commit is contained in:
parent
195cbfc012
commit
147cc4061e
@ -790,13 +790,21 @@ in
|
||||
'';
|
||||
};
|
||||
systemd.tmpfiles.settings."10-sourcehut-gitsrht" = mkIf cfg.git.enable (
|
||||
builtins.listToAttrs (map (name: {
|
||||
name = "/var/log/sourcehut/gitsrht-${name}";
|
||||
value.f = {
|
||||
inherit (cfg.git) user group;
|
||||
mode = "0644";
|
||||
};
|
||||
}) [ "keys" "shell" "update-hook" ])
|
||||
mkMerge [
|
||||
(builtins.listToAttrs (map (name: {
|
||||
name = "/var/log/sourcehut/gitsrht-${name}";
|
||||
value.f = {
|
||||
inherit (cfg.git) user group;
|
||||
mode = "0644";
|
||||
};
|
||||
}) [ "keys" "shell" "update-hook" ]))
|
||||
{
|
||||
${cfg.settings."git.sr.ht".repos}.d = {
|
||||
inherit (cfg.git) user group;
|
||||
mode = "0644";
|
||||
};
|
||||
}
|
||||
]
|
||||
);
|
||||
systemd.services.sshd = {
|
||||
preStart = mkIf cfg.hg.enable ''
|
||||
|
@ -49,8 +49,6 @@ in
|
||||
''
|
||||
start_all()
|
||||
machine.wait_for_unit("multi-user.target")
|
||||
# For some reason, OpenSSH fails to start on boot with code 226/NAMESPACE
|
||||
machine.systemctl("start sshd.service")
|
||||
machine.wait_for_unit("sshd.service")
|
||||
|
||||
with subtest("Check whether meta comes up"):
|
||||
|
Loading…
Reference in New Issue
Block a user