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}'"; + }; + + }; +}