hms and hmx
mods/hms.nix defines the repo's preferred rebuild helpers.
These are convenience wrappers for people already using this repo day to day. If you are only exploring, the plain nix build .#... commands in Daily Workflows are the simpler starting point.
What Gets Exposed
hmx.<host>, host-specific scripts withbuild,diff, andswitchactions for both NixOS and nix-darwin machines.hms, a helper that pulls the repo and runs one of those actions for the current machine.
Calling either script without an action is equivalent to switch, so existing hms and direct hmx.<host> usage keeps working.
Behavioral Notes
buildbuilds the system configuration and prints its store path without activating it.diffbuilds the system configuration, then usesnvd diffto show system closure changes.- On NixOS,
diffalso runsswitch-to-configuration dry-activateto show the systemd units and activation work that a switch would perform. - On nix-darwin,
diffalso lists changed launchd plist definitions. nix-darwin does not provide an activation planner equivalent to NixOSdry-activate. switchshows thenvd diff, updates the system profile, and activates the configuration.- Supports forced switching with
POG_FORCE=1. - On NixOS,
POG_BOOT_ONLY=1updates the system profile but runsswitch-to-configuration bootinstead ofswitch. - Handles both NixOS and darwin activation flows.
Typical Usage
bash
# build the current machine without activating it
hms build
# preview package and service changes for the current machine
hms diff
# switch the current machine using the repo's preferred helper
hms
# preview a specific host through its hmx output
$(nix build --no-link --print-out-paths --extra-experimental-features nix-command --extra-experimental-features flakes .#hmx.<host>)/bin/switch diff
# build or switch that host with the same wrapper
$(nix build --no-link --print-out-paths --extra-experimental-features nix-command --extra-experimental-features flakes .#hmx.<host>)/bin/switch build
$(nix build --no-link --print-out-paths --extra-experimental-features nix-command --extra-experimental-features flakes .#hmx.<host>)/bin/switch switchSource
mods/hms.nix- Daily Workflows