keep dropbear host keys in /persist if it exists

This commit is contained in:
Daniel Barlow
2023-05-21 12:01:42 +01:00
parent f249c12bec
commit a48d51ffdc
2 changed files with 6 additions and 4 deletions

View File

@@ -149,12 +149,14 @@ in rec {
run = "${pkgs.chrony}/bin/chronyd -f ${config} -d";
};
services.sshd = longrun {
name = "sshd";
run = ''
mkdir -p /run/dropbear
${dropbear}/bin/dropbear -E -P /run/dropbear.pid -R -F
if test -d /persist; then
mkdir -p /persist/secrets/dropbear
ln -s /persist/secrets/dropbear /run
fi
${dropbear}/bin/dropbear -E -R -P /run/dropbear.pid -F
'';
};