Fixed unwanted apparent outputs. Fixed cp bad path.
This commit is contained in:
@@ -68,7 +68,7 @@ necessary_credentials() {
|
|||||||
user_input "CF_DNS_API_TOKEN" "➡️ Please provide a cloudflare API token with DNS zone permission :" "bA7hdvCOuXGytlNKohi3ZGtlVpf5CHpLuCMiJrE" "" "" "true"
|
user_input "CF_DNS_API_TOKEN" "➡️ Please provide a cloudflare API token with DNS zone permission :" "bA7hdvCOuXGytlNKohi3ZGtlVpf5CHpLuCMiJrE" "" "" "true"
|
||||||
|
|
||||||
# SMTP SETTINGS
|
# SMTP SETTINGS
|
||||||
echo -e "\n\n➡️ Some services will be able to send you emails. For that you need an email that supports sending emails (like Gmail for example)."
|
echo -e "\n\n➡️ Some services will be able to send you emails. For that you need an email that supports sending emails (like Gmail for example).\n"
|
||||||
user_input "SENDER_EMAIL_ADDRESS" "➡️ Please provide a valid sender email address :" "myemail@gmail.com" "${EMAIL_REGEX}" "Invalid email address format."
|
user_input "SENDER_EMAIL_ADDRESS" "➡️ Please provide a valid sender email address :" "myemail@gmail.com" "${EMAIL_REGEX}" "Invalid email address format."
|
||||||
user_input "SENDER_EMAIL_ADDRESS_PASSWORD" "➡️ Please provide the password of this email address :" "abcd efgh ijkl mnop" "" "" "true"
|
user_input "SENDER_EMAIL_ADDRESS_PASSWORD" "➡️ Please provide the password of this email address :" "abcd efgh ijkl mnop" "" "" "true"
|
||||||
user_input "SENDER_EMAIL_DOMAIN" "➡️ Please provide the SMTP server endpoint :" "smtp.gmail.com" "${DOMAIN_REGEX}" "Invalid domain name format."
|
user_input "SENDER_EMAIL_DOMAIN" "➡️ Please provide the SMTP server endpoint :" "smtp.gmail.com" "${DOMAIN_REGEX}" "Invalid domain name format."
|
||||||
@@ -162,7 +162,7 @@ hardware_detection() {
|
|||||||
|
|
||||||
ssh_to_host 'bash -s' << SSHEND
|
ssh_to_host 'bash -s' << SSHEND
|
||||||
for brand in Intel AMD NVIDIA; do
|
for brand in Intel AMD NVIDIA; do
|
||||||
if lspci -nn | grep -i "vga" | grep -iq "\${brand}"; then
|
if lspci -nn 2>/dev/null | grep -i "vga" | grep -iq "\${brand}"; then
|
||||||
TARGET_GRAPHICS="true"
|
TARGET_GRAPHICS="true"
|
||||||
TARGET_GRAPHICS_BRAND+=("\${brand}")
|
TARGET_GRAPHICS_BRAND+=("\${brand}")
|
||||||
else
|
else
|
||||||
@@ -170,10 +170,10 @@ for brand in Intel AMD NVIDIA; do
|
|||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
ls /dev/dri/ | grep -iq "renderD128" && TARGET_GRAPHICS_RENDERER="true" || TARGET_GRAPHICS_RENDERER="false"
|
ls /dev/dri/ 2>/dev/null | grep -iq "renderD128" && TARGET_GRAPHICS_RENDERER="true" || TARGET_GRAPHICS_RENDERER="false"
|
||||||
lsusb | grep -iq "google" && TARGET_USB_CORAL="true" || TARGET_USB_CORAL="false"
|
lsusb 2>/dev/null | grep -iq "google" && TARGET_USB_CORAL="true" || TARGET_USB_CORAL="false"
|
||||||
lspci -nn | grep -iq "089a" && TARGET_PCIE_CORAL="true" || TARGET_PCIE_CORAL="false"
|
lspci -nn 2>/dev/null | grep -iq "089a" && TARGET_PCIE_CORAL="true" || TARGET_PCIE_CORAL="false"
|
||||||
ls /dev/serial/by-id/ | grep -i "zigbee" && TARGET_ZIGBEE_DEVICE=\$(ls /dev/serial/by-id/ | grep -i "zigbee" | head -n 1) || TARGET_ZIGBEE_DEVICE=""
|
ls /dev/serial/by-id/ 2>/dev/null | grep -i "zigbee" && TARGET_ZIGBEE_DEVICE=\$(ls /dev/serial/by-id/ 2>/dev/null | grep -i "zigbee" | head -n 1) || TARGET_ZIGBEE_DEVICE=""
|
||||||
|
|
||||||
for var in TARGET_GRAPHICS TARGET_GRAPHICS_BRAND TARGET_GRAPHICS_RENDERER TARGET_USB_CORAL TARGET_PCIE_CORAL TARGET_ZIGBEE_DEVICE; do
|
for var in TARGET_GRAPHICS TARGET_GRAPHICS_BRAND TARGET_GRAPHICS_RENDERER TARGET_USB_CORAL TARGET_PCIE_CORAL TARGET_ZIGBEE_DEVICE; do
|
||||||
echo "export \${var}=\${!var}" >> "${TMPFILE}"
|
echo "export \${var}=\${!var}" >> "${TMPFILE}"
|
||||||
@@ -185,7 +185,6 @@ SSHEND
|
|||||||
source "${TMPFILE}" && rm "${TMPFILE}"
|
source "${TMPFILE}" && rm "${TMPFILE}"
|
||||||
|
|
||||||
### --> Generate hardware-configuration.nix
|
### --> Generate hardware-configuration.nix
|
||||||
echo -e "\n\n 🔎 Generating hardware-configuration.nix from target host..."
|
|
||||||
if ssh_to_host "sudo nixos-generate-config --no-filesystems --show-hardware-config" > final-nix-config/etc/nixos/hardware-configuration.nix; then
|
if ssh_to_host "sudo nixos-generate-config --no-filesystems --show-hardware-config" > final-nix-config/etc/nixos/hardware-configuration.nix; then
|
||||||
echo -e "✅ Hardware configuration generated"
|
echo -e "✅ Hardware configuration generated"
|
||||||
else
|
else
|
||||||
@@ -235,7 +234,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/final-nix-config/etc/nixos/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/
|
||||||
|
|
||||||
echo -e "\n✅ Generating sops-nix keys..."
|
echo -e "\n✅ Generating sops-nix keys..."
|
||||||
|
|||||||
Reference in New Issue
Block a user