Get podman containers as services working. Added verbosity for the postrun_action to debug

This commit is contained in:
Raphaël Numbus
2026-01-09 15:57:29 +01:00
parent 92fa21df1f
commit 491c56909e
10 changed files with 30 additions and 11 deletions
+3 -2
View File
@@ -736,6 +736,7 @@ postrun_action() {
while FOUND="false"; do
if ping -c1 -W1 $HOME_SERVER_IP >/dev/null 2>&1; then
FOUND="true"
echo -e "\n✅ Ping ${HOME_SERVER_IP} successful ! Continuing..."
else
(i++)
if [[ "\${i}" -gt 150 ]]; then
@@ -747,8 +748,7 @@ postrun_action() {
done
ssh_to_host 'bash -s' << EOF
sed -i "s|# ./disks/pcr-check.nix| ./disks/pcr-check.nix|" /etc/nixos/configuration.nix
echo "Enrolling boot disk key to TPM..."
if [[ ${#BOOT_DISKS_ID[@]} -eq 1 ]]; then
echo $REMOTE_PASS | sudo -S systemd-cryptenroll --tpm2-device=auto --tpm2-pcrs=0+7 --unlock-key-file=/etc/secrets/disks/boot-1 /dev/${BOOT_DISKS_1_NAME}
elif [[ ${#BOOT_DISKS_ID[@]} -eq 2 ]]; then
@@ -756,6 +756,7 @@ elif [[ ${#BOOT_DISKS_ID[@]} -eq 2 ]]; then
echo $REMOTE_PASS | sudo -S systemd-cryptenroll --tpm2-device=auto --tpm2-pcrs=0+7 --unlock-key-file=/etc/secrets/disks/boot-2 /dev/${BOOT_DISKS_2_NAME}
fi
echo "Getting PCRS 15 hash..."
PCR_HASH=\$(echo $REMOTE_PASS | sudo -S systemd-analyze pcrs 15 --json=short)
sed -i "s|# systemIdentity.enable = true;| systemIdentity.enable = true;|" /etc/nixos/configuration.nix