Initial add systemd timer to keep config repo up to date
This commit is contained in:
parent
ba33f5f6cb
commit
cc257a396b
21
systemd/nixos-pull.nix
Normal file
21
systemd/nixos-pull.nix
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
{ 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";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
Loading…
Reference in a new issue