mirror of
https://github.com/caperren/nixos-configs.git
synced 2025-12-30 11:04:19 +00:00
15 lines
507 B
Nix
15 lines
507 B
Nix
{ config, pkgs, ... }:
|
|
{
|
|
systemd.services.git-auto-rebuild = {
|
|
enable = true;
|
|
after = [ "network.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 'cd /etc/nixos && /run/current-system/sw/bin/git pull && /run/current-system/sw/bin/nixos-rebuild switch --flake #$(hostname)'";
|
|
};
|
|
|
|
};
|
|
}
|