🏡 my personal home lab
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

refactor garage bootstrap

+5 -14
+5 -14
modules/garage.nix
··· 64 64 }; 65 65 path = [ config.services.garage.package ]; 66 66 script = '' 67 - # Wait for the garage RPC port to accept connections. 68 - for i in $(seq 1 30); do 69 - if garage status >/dev/null 2>&1; then 70 - break 71 - fi 72 - sleep 1 73 - done 67 + # Wait for garage to be reachable. 68 + for _ in $(seq 1 30); do garage status &>/dev/null && break; sleep 1; done 74 69 75 - status_output=$(garage status 2>&1) 76 - echo "garage status output:" 77 - echo "$status_output" 70 + status=$(garage status 2>&1) 71 + echo "$status" 78 72 79 - # Only assign a layout if our node hasn't been given a role yet. 80 - if echo "$status_output" | grep -q "NO ROLE ASSIGNED"; then 73 + if echo "$status" | grep -q "NO ROLE ASSIGNED"; then 81 74 node_id=$(garage node id -q | cut -d@ -f1) 82 - echo "Assigning layout to node $node_id" 83 75 garage layout assign -z dc1 -c 10G "$node_id" 84 - echo "Applying layout version 1" 85 76 garage layout apply --version 1 86 77 else 87 78 echo "Node already has a role, skipping layout assignment"