Add vars to mail.nix and fix disk details source
This commit is contained in:
@@ -234,7 +234,7 @@ for var in \
|
|||||||
DISK_HEALTH \
|
DISK_HEALTH \
|
||||||
DISK_ID \
|
DISK_ID \
|
||||||
DISK_SIZE; do
|
DISK_SIZE; do
|
||||||
declare -p \${var} >> "${TMPFILE}"
|
declare -p \${var} | sed 's/^declare /declare -g /' >> "${TMPFILE}"
|
||||||
done
|
done
|
||||||
SSHEND
|
SSHEND
|
||||||
### Get hardware information <--
|
### Get hardware information <--
|
||||||
@@ -290,8 +290,7 @@ files_generation() {
|
|||||||
echo -e "\n✅ Copying the configuration to the new machine..."
|
echo -e "\n✅ Copying the configuration to the new machine..."
|
||||||
cp -avu templates/nix-config/configuration.nix final-nix-config/etc/nixos/
|
cp -avu templates/nix-config/configuration.nix final-nix-config/etc/nixos/
|
||||||
cp -avu templates/nix-config/flake.nix final-nix-config/etc/nixos/
|
cp -avu templates/nix-config/flake.nix final-nix-config/etc/nixos/
|
||||||
cp -avu templates/nix-config/misc/networking.nix final-nix-config/etc/nixos/misc/
|
cp -avu templates/nix-config/misc/* final-nix-config/etc/nixos/misc/
|
||||||
envsubst < templates/nix-config/misc/mail.nix > final-nix-config/etc/nixos/misc/mail.nix
|
|
||||||
|
|
||||||
echo -e "\n✅ Generating sops-nix keys..."
|
echo -e "\n✅ Generating sops-nix keys..."
|
||||||
ssh-to-age -private-key -i final-nix-config/home/numbus-admin/.ssh/id_ed25519 > final-nix-config/var/lib/sops-nix/key.txt
|
ssh-to-age -private-key -i final-nix-config/home/numbus-admin/.ssh/id_ed25519 > final-nix-config/var/lib/sops-nix/key.txt
|
||||||
@@ -311,6 +310,10 @@ files_generation() {
|
|||||||
sed -i "s|HOME_SERVER_IP|${HOME_SERVER_IP}|g" final-nix-config/etc/nixos/misc/networking.nix
|
sed -i "s|HOME_SERVER_IP|${HOME_SERVER_IP}|g" final-nix-config/etc/nixos/misc/networking.nix
|
||||||
sed -i "s|HOME_ROUTER_IP|${HOME_ROUTER_IP}|g" final-nix-config/etc/nixos/misc/networking.nix
|
sed -i "s|HOME_ROUTER_IP|${HOME_ROUTER_IP}|g" final-nix-config/etc/nixos/misc/networking.nix
|
||||||
sed -i "s|TARGET_INTERFACE|${TARGET_INTERFACE}|g" final-nix-config/etc/nixos/misc/networking.nix
|
sed -i "s|TARGET_INTERFACE|${TARGET_INTERFACE}|g" final-nix-config/etc/nixos/misc/networking.nix
|
||||||
|
sed -i "s|DOMAIN_NAME|${DOMAIN_NAME}|g" final-nix-config/etc/nixos/misc/mail.nix
|
||||||
|
sed -i "s|EMAIL_ADDRESS|${EMAIL_ADDRESS}|g" final-nix-config/etc/nixos/misc/mail.nix
|
||||||
|
sed -i "s|TARGET_INTERFACE|${SENDER_EMAIL_DOMAIN}|g" final-nix-config/etc/nixos/misc/mail.nix
|
||||||
|
sed -i "s|TARGET_INTERFACE|${SENDER_EMAIL_ADDRESS}|g" final-nix-config/etc/nixos/misc/mail.nix
|
||||||
|
|
||||||
echo -e "\n✅ Writing configuration files for the selected homelab services..."
|
echo -e "\n✅ Writing configuration files for the selected homelab services..."
|
||||||
envsubst < templates/podman-config/traefik/traefik.yaml > final-nix-config/mnt/config/traefik/traefik.yaml
|
envsubst < templates/podman-config/traefik/traefik.yaml > final-nix-config/mnt/config/traefik/traefik.yaml
|
||||||
@@ -397,8 +400,6 @@ disk_config_generation() {
|
|||||||
|
|
||||||
|
|
||||||
### --> Disk selection
|
### --> Disk selection
|
||||||
source "${TMPFILE}"
|
|
||||||
|
|
||||||
if [[ "${#DISK_NAME[@]}" -eq 0 ]]; then
|
if [[ "${#DISK_NAME[@]}" -eq 0 ]]; then
|
||||||
echo -e "\n❌ No disks found on the target host. Aborting."
|
echo -e "\n❌ No disks found on the target host. Aborting."
|
||||||
exit 1
|
exit 1
|
||||||
|
|||||||
@@ -11,22 +11,22 @@ in
|
|||||||
fromAddress = lib.mkOption {
|
fromAddress = lib.mkOption {
|
||||||
description = "The 'from' address";
|
description = "The 'from' address";
|
||||||
type = lib.types.str;
|
type = lib.types.str;
|
||||||
default = "no-reply@${DOMAIN_NAME}";
|
default = "no-reply@DOMAIN_NAME";
|
||||||
};
|
};
|
||||||
toAddress = lib.mkOption {
|
toAddress = lib.mkOption {
|
||||||
description = "The 'to' address";
|
description = "The 'to' address";
|
||||||
type = lib.types.str;
|
type = lib.types.str;
|
||||||
default = "${EMAIL_ADDRESS}";
|
default = "EMAIL_ADDRESS";
|
||||||
};
|
};
|
||||||
smtpServer = lib.mkOption {
|
smtpServer = lib.mkOption {
|
||||||
description = "The SMTP server address";
|
description = "The SMTP server address";
|
||||||
type = lib.types.str;
|
type = lib.types.str;
|
||||||
default = "${SENDER_EMAIL_DOMAIN}";
|
default = "SENDER_EMAIL_DOMAIN";
|
||||||
};
|
};
|
||||||
smtpUsername = lib.mkOption {
|
smtpUsername = lib.mkOption {
|
||||||
description = "The SMTP username";
|
description = "The SMTP username";
|
||||||
type = lib.types.str;
|
type = lib.types.str;
|
||||||
default = "${SENDER_EMAIL_ADDRESS}";
|
default = "SENDER_EMAIL_ADDRESS";
|
||||||
};
|
};
|
||||||
smtpPasswordPath = lib.mkOption {
|
smtpPasswordPath = lib.mkOption {
|
||||||
description = "Path to the secret containing SMTP password";
|
description = "Path to the secret containing SMTP password";
|
||||||
|
|||||||
Reference in New Issue
Block a user