Added programs to list and removed unnecessary variables.

This commit is contained in:
Raphaël Billet
2025-11-26 20:02:25 +01:00
parent de450f56f8
commit c515903610
Regular → Executable
+2 -4
View File
@@ -1,5 +1,5 @@
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p gum openssl sops ssh-to-age age sshpass envsubst
#!nix-shell -i bash -p gum openssl sops ssh-to-age age sshpass envsubst pciutils usbutils
prerun_action() {
echo -e "$1"
@@ -128,10 +128,8 @@ hardware_detection() {
if ssh_to_host "ls /dev/serial/by-id/ | grep -i 'zigbee'" 2>/dev/null; then
echo -e " ✅ Zigbee device found in /dev/serial/by-id/."
TARGET_ZIGBEE_DEVICE=$(ssh_to_host "ls /dev/serial/by-id/ | grep -i 'zigbee'")
TARGET_ZIGBEE="true"
else
echo -e " ️ No Zigbee device found."
TARGET_ZIGBEE="false"
fi
}
@@ -186,7 +184,7 @@ files_generation() {
sed -i.bak "/# --- frigate devices --- #/d" docker/frigate.nix
fi
if [[ "$TARGET_ZIGBEE" == "true" ]]; then
if [[ -n "$TARGET_ZIGBEE_DEVICE" ]]; then
REPLACEMENT="devices:\n - /dev/serial/by-id/${TARGET_ZIGBEE_DEVICE}:/dev/ttyUSB0"
sed -i.bak "s|# --- hass devices --- #|$REPLACEMENT|" docker/hass.nix
else