Below is a pragmatic “inherit‑from‑a‑base‑machine” recipe that works with XState v5 today.
The key idea is that you separate structure (the config object that declares states, transitions, context, …) from implementation (actions, guards, actors, delays).
// alarmConfig.ts
import { TypegenDisable } from 'xstate'; // if you are not using typegen