Updates. Bugfixes.
This commit is contained in:
@@ -901,17 +901,22 @@ postrun_action() {
|
|||||||
if gum confirm "➡️ I understand, 'yes' to proceed."; then
|
if gum confirm "➡️ I understand, 'yes' to proceed."; then
|
||||||
ssh_to_host 'bash -s' << EOF
|
ssh_to_host 'bash -s' << EOF
|
||||||
echo "Enrolling boot disk key to TPM..."
|
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_DISK_1_NAME}
|
j=1
|
||||||
elif [[ ${#BOOT_DISKS_ID[@]} -eq 2 ]]; then
|
for i in ${!BOOT_DISKS_ID[@]}; do
|
||||||
echo ${REMOTE_PASS} | sudo -S systemd-cryptenroll --tpm2-device=auto --tpm2-pcrs=0+7 --unlock-key-file=/etc/secrets/disks/boot-1 /dev/${BOOT_DISK_1_NAME}
|
if [[ echo "${BOOT_DISKS_ID[${i}]}" | grep -iq "nvme" ]]; 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_DISK_2_NAME}
|
DISK_PATH="/dev/${BOOT_DISKS_ID[${i}]}p2"
|
||||||
fi
|
else
|
||||||
|
DISK_PATH="/dev/${BOOT_DISKS_ID[${i}]}2"
|
||||||
|
fi
|
||||||
|
echo ${REMOTE_PASS} | sudo -S systemd-cryptenroll --tpm2-device=auto --tpm2-pcrs=0+7 --unlock-key-file=/etc/secrets/disks/boot-${j} ${DISK_PATH}
|
||||||
|
((j++))
|
||||||
|
done
|
||||||
|
|
||||||
echo "Getting PCRS 15 hash..."
|
echo "Getting PCRS 15 hash..."
|
||||||
PCR_HASH=\$(echo ${REMOTE_PASS} | sudo -S systemd-analyze pcrs 15 --json=short)
|
PCR_HASH=\$(echo ${REMOTE_PASS} | sudo -S systemd-analyze pcrs 15 --json=short)
|
||||||
|
|
||||||
sed -i "s|PCR_HASH|\${PCR_HASH}|" /etc/nixos/configuration.nix
|
echo ${REMOTE_PASS} | sudo -S sed -i "s|PCR_HASH|\${PCR_HASH}|" /etc/nixos/configuration.nix
|
||||||
EOF
|
EOF
|
||||||
else
|
else
|
||||||
echo "Skipping TPM configuration."
|
echo "Skipping TPM configuration."
|
||||||
|
|||||||
@@ -47,6 +47,10 @@
|
|||||||
boot.swraid.mdadmConf = "MAILADDR ${config.email.userAddress},${config.email.adminAddress}";
|
boot.swraid.mdadmConf = "MAILADDR ${config.email.userAddress},${config.email.adminAddress}";
|
||||||
# boot.initrd.systemd.tpm2.enable = true;
|
# boot.initrd.systemd.tpm2.enable = true;
|
||||||
|
|
||||||
|
boot.kernel.sysctl = {
|
||||||
|
vm.overcommit_memory=1;
|
||||||
|
};
|
||||||
|
|
||||||
# # TPM2 PCR check
|
# # TPM2 PCR check
|
||||||
# systemIdentity.enable = true;
|
# systemIdentity.enable = true;
|
||||||
# systemIdentity.pcr15 = "PCR_HASH";
|
# systemIdentity.pcr15 = "PCR_HASH";
|
||||||
@@ -122,6 +126,7 @@
|
|||||||
|
|
||||||
# Enable Podman
|
# Enable Podman
|
||||||
virtualisation.podman.enable = true;
|
virtualisation.podman.enable = true;
|
||||||
|
virtualisation.podman.defaultNetwork.settings.dns_enabled = true;
|
||||||
|
|
||||||
# Enable libvirt
|
# Enable libvirt
|
||||||
# virtualisation.libvirtd.enable = true;
|
# virtualisation.libvirtd.enable = true;
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
# Bridge configuration for VMs
|
# Bridge configuration for VMs
|
||||||
networking.bridges.br0.interfaces = [ "TARGET_INTERFACE" ];
|
networking.bridges.br0.interfaces = [ "TARGET_INTERFACE" ];
|
||||||
networking.interfaces.br0.useDHCP = false;
|
networking.interfaces.br0.useDHCP = false;
|
||||||
networking.nameservers = [ "9.9.9.9" ];
|
networking.nameservers = [ "HOME_SERVER_IP" "9.9.9.9" ];
|
||||||
networking.interfaces.br0.ipv4.addresses = [{
|
networking.interfaces.br0.ipv4.addresses = [{
|
||||||
address = "HOME_SERVER_IP";
|
address = "HOME_SERVER_IP";
|
||||||
prefixLength = 24;
|
prefixLength = 24;
|
||||||
|
|||||||
@@ -38,6 +38,7 @@ in
|
|||||||
# --- frigate devices --- #
|
# --- frigate devices --- #
|
||||||
labels:
|
labels:
|
||||||
- traefik.enable=true
|
- traefik.enable=true
|
||||||
|
- traefik.docker.network=home-assistant_frontend
|
||||||
- traefik.http.services.frigate.loadbalancer.server.port=8971
|
- traefik.http.services.frigate.loadbalancer.server.port=8971
|
||||||
- traefik.http.services.frigate.loadbalancer.server.scheme=http
|
- traefik.http.services.frigate.loadbalancer.server.scheme=http
|
||||||
- traefik.http.routers.frigate-https.entrypoints=websecure
|
- traefik.http.routers.frigate-https.entrypoints=websecure
|
||||||
|
|||||||
@@ -24,8 +24,6 @@ in
|
|||||||
- /run/user/1000/podman/podman.sock:/var/run/docker.sock:ro
|
- /run/user/1000/podman/podman.sock:/var/run/docker.sock:ro
|
||||||
environment:
|
environment:
|
||||||
APACHE_PORT: 11000
|
APACHE_PORT: 11000
|
||||||
NEXTCLOUD_TRUSTED_DOMAINS: nextcloud.$DOMAIN_NAME nextcloud-aio.$DOMAIN_NAME
|
|
||||||
TRUSTED_PROXIES: 172.16.1.253
|
|
||||||
APACHE_IP_BINDING: 127.0.0.1
|
APACHE_IP_BINDING: 127.0.0.1
|
||||||
NEXTCLOUD_DATADIR: ${data_dir}
|
NEXTCLOUD_DATADIR: ${data_dir}
|
||||||
NEXTCLOUD_ENABLE_DRI_DEVICE: $NEXTCLOUD_ENABLE_DRI_DEVICE
|
NEXTCLOUD_ENABLE_DRI_DEVICE: $NEXTCLOUD_ENABLE_DRI_DEVICE
|
||||||
|
|||||||
@@ -31,7 +31,6 @@ TRAEFIK_NETWORKS
|
|||||||
- CF_DNS_API_TOKEN=$CF_DNS_API_TOKEN
|
- CF_DNS_API_TOKEN=$CF_DNS_API_TOKEN
|
||||||
labels:
|
labels:
|
||||||
- traefik.enable=true
|
- traefik.enable=true
|
||||||
- traefik.docker.network=home-assistant_frontend
|
|
||||||
- traefik.http.services.traefik.loadbalancer.server.port=8080
|
- traefik.http.services.traefik.loadbalancer.server.port=8080
|
||||||
- traefik.http.services.traefik.loadbalancer.server.scheme=http
|
- traefik.http.services.traefik.loadbalancer.server.scheme=http
|
||||||
- traefik.http.routers.traefik-https.entrypoints=websecure
|
- traefik.http.routers.traefik-https.entrypoints=websecure
|
||||||
@@ -45,7 +44,7 @@ TRAEFIK_REF_NETWORKS
|
|||||||
|
|
||||||
systemd.services.traefik = {
|
systemd.services.traefik = {
|
||||||
description = "Podman container : ${container_name}";
|
description = "Podman container : ${container_name}";
|
||||||
after = [ "numbus-activation-networked.service" "numbus-activation-chowned.service" ];
|
after = [ "numbus-activation.service" ];
|
||||||
wantedBy = [ "multi-user.target" ];
|
wantedBy = [ "multi-user.target" ];
|
||||||
path = [ pkgs.podman pkgs.coreutils ];
|
path = [ pkgs.podman pkgs.coreutils ];
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user