From 8c77631f68806a58e742f0ba10b56d7efe40f837 Mon Sep 17 00:00:00 2001 From: Ryan Hughes Date: Sun, 21 Jun 2026 02:25:11 -0400 Subject: [PATCH] Delegate Snapper setup to Omarchy packages --- configs/airootfs/root/configurator | 5 -- .../omarchy-iso/orchestrator/phases_impl.py | 63 +------------------ manifests/fresh-4-semantic.json | 4 +- manifests/fresh-4.json | 4 +- 4 files changed, 6 insertions(+), 70 deletions(-) diff --git a/configs/airootfs/root/configurator b/configs/airootfs/root/configurator index 4c27c6e..7fcbad6 100644 --- a/configs/airootfs/root/configurator +++ b/configs/airootfs/root/configurator @@ -1314,11 +1314,6 @@ cat <<-_EOF_ >user_configuration.json } }, "disk_config": { - "btrfs_options": { - "snapshot_config": { - "type": "Snapper" - } - }, "config_type": "default_layout", "device_modifications": [ { diff --git a/configs/airootfs/usr/share/omarchy-iso/orchestrator/phases_impl.py b/configs/airootfs/usr/share/omarchy-iso/orchestrator/phases_impl.py index d8808c0..2e90d88 100644 --- a/configs/airootfs/usr/share/omarchy-iso/orchestrator/phases_impl.py +++ b/configs/airootfs/usr/share/omarchy-iso/orchestrator/phases_impl.py @@ -9,9 +9,9 @@ Phase ordering (full-disk and protected/pre-mounted): pre_mounted_config; no-op for full-disk installs arch_install_system → one archinstall flow for partition/mount-or-use, base install, early Omarchy packages, Limine setup, - useradd, runtime Omarchy packages, Snapper, fstab + useradd, runtime Omarchy packages, fstab configure_hibernation → root-owned swap/resume drop-ins - run_system_finalizer → arch-chroot root omarchy-setup-system + run_system_finalizer → arch-chroot root omarchy-setup-system, including Snapper finalize_limine_boot → final Limine config/UKI build after hardware drop-ins run_chroot_finalizer → arch-chroot -u user omarchy-finalize-user configure_login → sddm state + encrypted-install autologin @@ -275,9 +275,6 @@ def arch_install_system(ctx: InstallContext) -> None: finally: _unmask_mkinitcpio_pacman_hooks(ctx) - info("› configuring root Snapper snapshots") - _configure_snapper_root(ctx) - # Standard arch finishers. if config.timezone: installer.set_timezone(config.timezone) @@ -540,57 +537,6 @@ def _installer_esp_mount(installer) -> str: return "/boot" -def _configure_snapper_root(ctx: InstallContext) -> None: - """Configure Omarchy's root-only Snapper setup during the archinstall - phase, not inside the finalizer chroot. - - archinstall's own setup_btrfs_snapshot() uses `snapper --no-dbus` because - snapperd/DBus are not available in arch-chroot. We mirror that proven - chroot-safe call, but only create the root config: Omarchy intentionally - does not snapshot /home user data. - """ - config_path = ctx.target / "etc" / "snapper" / "configs" / "root" - if not config_path.exists(): - subprocess.run( - [ - "arch-chroot", - "-S", - str(ctx.target), - "snapper", - "--no-dbus", - "-c", - "root", - "create-config", - "/", - ], - check=True, - ) - - template_candidates = [ - ctx.target / "etc" / "snapper" / "config-templates" / "omarchy", - ctx.target / "usr" / "share" / "omarchy" / "default" / "snapper" / "root", - ] - template = next((path for path in template_candidates if path.exists()), None) - if template is None: - searched = "\n ".join(str(path) for path in template_candidates) - raise RuntimeError(f"Snapper root template not found. Searched:\n {searched}") - - config_path.parent.mkdir(parents=True, exist_ok=True) - shutil.copy2(template, config_path) - - conf_path = ctx.target / "etc" / "conf.d" / "snapper" - conf_path.parent.mkdir(parents=True, exist_ok=True) - if conf_path.exists(): - text = conf_path.read_text() - if re.search(r"^SNAPPER_CONFIGS=", text, flags=re.MULTILINE): - text = re.sub(r'^SNAPPER_CONFIGS=.*$', 'SNAPPER_CONFIGS="root"', text, flags=re.MULTILINE) - else: - text = text.rstrip() + '\nSNAPPER_CONFIGS="root"\n' - conf_path.write_text(text) - else: - conf_path.write_text('SNAPPER_CONFIGS="root"\n') - - def _limine_template(ctx: InstallContext, filename: str) -> Path: candidates = [ @@ -1134,11 +1080,6 @@ def finalize_limine_boot(ctx: InstallContext) -> None: check=False, capture_output=True, ) - subprocess.run( - ["arch-chroot", str(ctx.target), "systemctl", "enable", "limine-snapper-sync.service"], - check=True, - ) - if "Omarchy" not in limine_conf.read_text(): raise RuntimeError(f"{limine_conf} has no Omarchy entry") if "cryptdevice=" in cmdline and "cryptdevice=" not in limine_conf.read_text(): diff --git a/manifests/fresh-4-semantic.json b/manifests/fresh-4-semantic.json index bc448a0..faafcba 100644 --- a/manifests/fresh-4-semantic.json +++ b/manifests/fresh-4-semantic.json @@ -1429,11 +1429,11 @@ "uid": 0, "user": "root" }, - "/etc/systemd/system/timers.target.wants/snapper-timeline.timer": { + "/etc/systemd/system/timers.target.wants/snapper-cleanup.timer": { "gid": 0, "group": "root", "mode": "0o777", - "target": "/usr/lib/systemd/system/snapper-timeline.timer", + "target": "/usr/lib/systemd/system/snapper-cleanup.timer", "type": "symlink", "uid": 0, "user": "root" diff --git a/manifests/fresh-4.json b/manifests/fresh-4.json index fba07a3..6e64ea3 100644 --- a/manifests/fresh-4.json +++ b/manifests/fresh-4.json @@ -1381,11 +1381,11 @@ "uid": 0, "user": "root" }, - "/etc/systemd/system/timers.target.wants/snapper-timeline.timer": { + "/etc/systemd/system/timers.target.wants/snapper-cleanup.timer": { "gid": 0, "group": "root", "mode": "0o777", - "target": "/usr/lib/systemd/system/snapper-timeline.timer", + "target": "/usr/lib/systemd/system/snapper-cleanup.timer", "type": "symlink", "uid": 0, "user": "root"