diff --git a/deploy.sh b/deploy.sh index d409ae3..242f963 100644 --- a/deploy.sh +++ b/deploy.sh @@ -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 diff --git a/templates/nix-config/podman/frigate.nix b/templates/nix-config/podman/frigate.nix index 4d70590..db4e3f0 100644 --- a/templates/nix-config/podman/frigate.nix +++ b/templates/nix-config/podman/frigate.nix @@ -55,8 +55,10 @@ in systemd.services.${container_name} = { description = "Podman container : ${container_name}"; - after = [ "network.target" "traefik.service" ]; + after = [ "network.target" ]; + requires = [ "traefik.service" ]; wantedBy = [ "multi-user.target" ]; + path = [ pkgs.podman ]; serviceConfig = { User = "numbus-admin"; diff --git a/templates/nix-config/podman/gitea.nix b/templates/nix-config/podman/gitea.nix index 8976140..42a40ac 100644 --- a/templates/nix-config/podman/gitea.nix +++ b/templates/nix-config/podman/gitea.nix @@ -68,8 +68,10 @@ in systemd.services.${container_name} = { description = "Podman container : ${container_name}"; - after = [ "network.target" "traefik.service" ]; + after = [ "network.target" ]; + requires = [ "traefik.service" ]; wantedBy = [ "multi-user.target" ]; + path = [ pkgs.podman ]; serviceConfig = { User = "numbus-admin"; diff --git a/templates/nix-config/podman/home-assistant.nix b/templates/nix-config/podman/home-assistant.nix index 71e1455..b8587e5 100644 --- a/templates/nix-config/podman/home-assistant.nix +++ b/templates/nix-config/podman/home-assistant.nix @@ -54,8 +54,10 @@ in ''; systemd.services.${container_name} = { description = "Podman container : ${container_name}"; - after = [ "network.target" "traefik.service" ]; + after = [ "network.target" ]; + requires = [ "traefik.service" ]; wantedBy = [ "multi-user.target" ]; + path = [ pkgs.podman ]; serviceConfig = { User = "numbus-admin"; diff --git a/templates/nix-config/podman/immich.nix b/templates/nix-config/podman/immich.nix index 485b487..ee5949e 100644 --- a/templates/nix-config/podman/immich.nix +++ b/templates/nix-config/podman/immich.nix @@ -91,8 +91,10 @@ in systemd.services.${container_name} = { description = "Podman container : ${container_name}"; - after = [ "network.target" "traefik.service" ]; + after = [ "network.target" ]; + requires = [ "traefik.service" ]; wantedBy = [ "multi-user.target" ]; + path = [ pkgs.podman ]; serviceConfig = { User = "numbus-admin"; diff --git a/templates/nix-config/podman/it-tools.nix b/templates/nix-config/podman/it-tools.nix index edcb6c7..98b1720 100644 --- a/templates/nix-config/podman/it-tools.nix +++ b/templates/nix-config/podman/it-tools.nix @@ -34,8 +34,10 @@ in systemd.services.${container_name} = { description = "Podman container : ${container_name}"; - after = [ "network.target" "traefik.service" ]; + after = [ "network.target" ]; + requires = [ "traefik.service" ]; wantedBy = [ "multi-user.target" ]; + path = [ pkgs.podman ]; serviceConfig = { User = "numbus-admin"; diff --git a/templates/nix-config/podman/nextcloud.nix b/templates/nix-config/podman/nextcloud.nix index dfb055c..000e1fa 100644 --- a/templates/nix-config/podman/nextcloud.nix +++ b/templates/nix-config/podman/nextcloud.nix @@ -57,8 +57,10 @@ in systemd.services.${container_name} = { description = "Podman container : ${container_name}"; - after = [ "network.target" "traefik.service" ]; + after = [ "network.target" ]; + requires = [ "traefik.service" ]; wantedBy = [ "multi-user.target" ]; + path = [ pkgs.podman ]; serviceConfig = { User = "numbus-admin"; diff --git a/templates/nix-config/podman/passbolt.nix b/templates/nix-config/podman/passbolt.nix index 6cfe89d..00c5d09 100644 --- a/templates/nix-config/podman/passbolt.nix +++ b/templates/nix-config/podman/passbolt.nix @@ -86,8 +86,10 @@ in systemd.services.${container_name} = { description = "Podman container : ${container_name}"; - after = [ "network.target" "traefik.service" ]; + after = [ "network.target" ]; + requires = [ "traefik.service" ]; wantedBy = [ "multi-user.target" ]; + path = [ pkgs.podman ]; serviceConfig = { User = "numbus-admin"; diff --git a/templates/nix-config/podman/pi-hole.nix b/templates/nix-config/podman/pi-hole.nix index b51aa25..034e317 100644 --- a/templates/nix-config/podman/pi-hole.nix +++ b/templates/nix-config/podman/pi-hole.nix @@ -62,8 +62,10 @@ in ''; systemd.services.${container_name} = { description = "Podman container : ${container_name}"; - after = [ "network.target" "traefik.service" ]; + after = [ "network.target" ]; + requires = [ "traefik.service" ]; wantedBy = [ "multi-user.target" ]; + path = [ pkgs.podman ]; serviceConfig = { User = "numbus-admin"; diff --git a/templates/nix-config/podman/traefik.nix b/templates/nix-config/podman/traefik.nix index 0b9e3d1..db1a0e8 100644 --- a/templates/nix-config/podman/traefik.nix +++ b/templates/nix-config/podman/traefik.nix @@ -44,8 +44,10 @@ TRAEFIK_REF_NETWORKS systemd.services.traefik = { description = "Podman container : ${container_name}"; - after = [ "network.target" "numbus-activation-networked.service" "numbus-activation-chowned.service" ]; + after = [ "network.target" ]; + requires = [ "numbus-activation-networked.service" "numbus-activation-chowned.service" ]; wantedBy = [ "multi-user.target" ]; + path = [ pkgs.podman ]; serviceConfig = { User = "numbus-admin";