State Massage, massages the state, until it matches a given set of tasks. Basically ansible, minus a lot of the features, plus speed. Not exactly fast, but much faster.
This is primarily for use on systems, that do not run guix, and thus, rely on massaging.
Tasks are defined in tasks.ini
, and are run in order. Here's an example:
[task.21]
title = Create systemd service for Guix garbage collector
opt = copy
src = files/guix-gc.service
dest = /etc/systemd/system/guix-gc.service
[task.22]
title = Create systemd timer for Guix garbage collector
opt = copy
src = files/guix-gc.timer
dest = /etc/systemd/system/guix-gc.timer
[task.23]
title = Reload systemd and enable Guix garbage collector timer
opt = systemd
daemon_reload = yes
enabled = yes
state = started
name = guix-gc.timer
Unlike ansible, you can deprecate existing tasks, which simply means that they are reverted.
[task.26]
title = Reload systemd and enable Guix pull timer
opt = systemd
daemon_reload = yes
enabled = yes
state = started
name = guix-pull.timer
deprecated = yes
Two operations are supported:
copy
: Copies a file fromsrc
todest
.systemd
: Performs a systemd operation.
--operation
:validate
: Validates the tasks.run
: Runs the tasks.dry-run
: Simulates the tasks.
--tasks-path
: Path to tasks (ini
); defaults to$cwd/tasks.ini
--copy-dest
: Defaults to whatever is defined in your tasks. Overwrite for testing...
state-massage --operation run
One-liner on guix:
guix shell python -- python3 -m state_massage.main --operation dry-run
You need to use Docker to run tests, because they rely on systemd:
python3 run-tests.py