Matrix: Difference between revisions

m disable livekit auto room creation as per lk-jwt-service upstream docs
m livekit: simplify key creation unit with ConditionPathExists
Line 188: Line 188:
     path = with pkgs; [ livekit coreutils gawk ];
     path = with pkgs; [ livekit coreutils gawk ];
     script = ''
     script = ''
      if [ -f ${keyFile} ]; then
        echo "Key exists"
      else
         echo "Key missing, generating key"
         echo "Key missing, generating key"
         echo "lk-jwt-service: $(livekit-server generate-keys | tail -1 | awk '{print $3}')" > "${keyFile}"
         echo "lk-jwt-service: $(livekit-server generate-keys | tail -1 | awk '{print $3}')" > "${keyFile}"
      fi
     '';
     '';
     serviceConfig.Type = "oneshot";
     serviceConfig.Type = "oneshot";
    unitConfig.ConditionPathExists = "!${keyFile}";
   };
   };
   # restrict access to livekit room creation to a homeserver
   # restrict access to livekit room creation to a homeserver