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
'';
};

View file

@ -32,7 +32,7 @@ in
in runCommand "make-jffs2" {
depsBuildBuild = [ mtdutils ];
} ''
mkdir -p $TMPDIR/empty/nix/store/
mkdir -p $TMPDIR/empty/nix/store/ $TMPDIR/empty/secrets
cp ${systemConfiguration}/bin/activate $TMPDIR/empty/activate
ln -s ${pkgs.s6-init-bin}/bin/init $TMPDIR/empty/init
grafts=$(sed < ${systemConfiguration}/etc/nix-store-paths 's/^\(.*\)$/--graft \1:\1/g')