Automatically track the configuration of each machine in a git branch #119

Open
opened 2025-06-18 15:32:53 +02:00 by rarias · 0 comments
Owner

As we change configuration of machines, it becomes harder to know at which commit each machine is. It would be nice to have a branch per machine with the activated config. This way we can:

  • git diff m/$(hostname) HEAD which changes I would introduce in the current machine if I ran a nixos-rebuild switch.

  • git diff m/hut m/tent show the differences among machines.

  • git log --graph --all would show in a single graph where all machines are and which ones need to be updated.

This can be implemented with a systemd daemon that runs on activation after the network is ready, using a robot user that has push access to the gitea repository. We can keep a copy of the current configuration in the nix store (including git history) and then push it to the corresponding machine branch.

As we change configuration of machines, it becomes harder to know at which commit each machine is. It would be nice to have a branch per machine with the activated config. This way we can: - `git diff m/$(hostname) HEAD` which changes I would introduce in the current machine if I ran a `nixos-rebuild switch`. - `git diff m/hut m/tent` show the differences among machines. - `git log --graph --all` would show in a single graph where all machines are and which ones need to be updated. This can be implemented with a systemd daemon that runs on activation after the network is ready, using a robot user that has push access to the gitea repository. We can keep a copy of the current configuration in the nix store (including git history) and then push it to the corresponding machine branch.
rarias added the
nix
label 2025-06-18 15:32:59 +02:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: rarias/jungle#119
No description provided.