mirror of
https://github.com/kuhyx/utils.git
synced 2026-11-11 00:47:13 +01:00
Extracts the chattr+bind-mount+systemd-watcher file-locking pattern (and a new pacman PreTransaction package-block primitive) out of screen-locker and steam-backlog-enforcer into a standalone, config-driven library so both projects (and steam-backlog-enforcer's new block-gaming feature) can share one implementation instead of maintaining parallel copies. - guardctl: CLI entry point (file-guard, package-block subcommands) - lib/file_guard.sh: chattr +i / bind-mount / systemd-path-watcher / pacman hook enforcement for a single target file, keyed by /etc/guard-lib/targets config; includes `sync` (adopt current content as canonical - for a caller's own legitimate edit) distinct from `pacman-relock` (revert drift) - lib/package_block.sh: time-locked pacman PreTransaction hook that refuses to (re)install a given package while a lock file's `until` timestamp is in the future; supports --bind-mount to compose with file-guard on the same lock file - pacman-hooks/: the installed hook scripts + .hook definitions - systemd/: guard-file@.path/.service watcher units, guard-bind-mount@.service Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AFNiYQQgSLAkiBXswyimPq
11 lines
320 B
SYSTEMD
11 lines
320 B
SYSTEMD
[Unit]
|
|
Description=guard-lib file-guard watcher for %i
|
|
# PathModified= for this instance is supplied by a drop-in written at
|
|
# `guardctl file-guard install` time, under guard-file@%i.path.d/override.conf.
|
|
# This template unit is never started directly without that drop-in.
|
|
|
|
[Path]
|
|
|
|
[Install]
|
|
WantedBy=multi-user.target
|