nixos/systemd/nixos-pull.nix

22 lines
504 B
Nix

{ pkgs, ... }:
{
systemd.timers."nixos-pull-config" = {
wantedBy = [ "timers.target" ];
description = "Timer to update /etc/nixos/config/ repository";
timerConfig = {
OnBootSec = "5m";
OnUnitActiveSec = "5m";
Unit = "hello-world.service";
};
};
systemd.services."nixos-pull-config" = {
script = ''
${pkgs.git}/bin/git pull -C /etc/nixos/config/ --ff-only --no-edit
'';
serviceConfig = {
Type = "oneshot";
User = "root";
};
};
}