From 8c4de5f015dafa194835acb9926a2049d6481fa9 Mon Sep 17 00:00:00 2001 From: Corwin Perren Date: Sun, 7 Dec 2025 19:45:59 -0800 Subject: [PATCH] Testing git auto-rebuild for cluster --- modules/host-groups/cluster.nix | 1 + modules/system/git-auto-rebuild.nix | 15 +++++++++++++++ 2 files changed, 16 insertions(+) create mode 100644 modules/system/git-auto-rebuild.nix diff --git a/modules/host-groups/cluster.nix b/modules/host-groups/cluster.nix index f3eec0e..f827f4d 100644 --- a/modules/host-groups/cluster.nix +++ b/modules/host-groups/cluster.nix @@ -8,6 +8,7 @@ # System Configuration ../system/cpu-amd.nix ../system/fonts.nix + ../system/git-auto-rebuild.nix ../system/gpu-amd.nix ../system/home-manager-settings.nix ../system/internationalization.nix diff --git a/modules/system/git-auto-rebuild.nix b/modules/system/git-auto-rebuild.nix new file mode 100644 index 0000000..4fe4cc6 --- /dev/null +++ b/modules/system/git-auto-rebuild.nix @@ -0,0 +1,15 @@ +{ config, pkgs, ... }: +{ + systemd.services.git-auto-rebuild = { +# enable = true; + after = [ "network.target" ]; + wantedBy = [ "multi-user.target" ]; + description = "Rebuilds the git repo at /etc/nixos if there are changes in the currently checked out branch"; + # startAt = "*:0/1"; + serviceConfig = { + Type = "simple"; + ExecStart = "/run/current-system/sw/bin/bash -c '/etc/nixos && sudo nixos-rebuild switch --flake #${networking.hostname}'"; + }; + + }; +}