this works

This commit is contained in:
Noa Aarts 2024-06-06 08:41:01 +02:00
parent 0b67ad987d
commit 412ee8149e

View file

@ -267,39 +267,43 @@
flatpak.enable = true; flatpak.enable = true;
}; };
systemd.timers."update-flake" = { systemd = {
wantedBy = [ "timers.target" ]; timers."update-flake" = {
timerConfig = { wantedBy = [ "timers.target" ];
OnCalendar = "daily"; timerConfig = {
Persistent = true; OnCalendar = "daily";
Persistent = true;
};
}; };
};
systemd.services."update-flake" = { services = {
path = with pkgs; [ "update-flake" = {
git path = with pkgs; [
openssh git
nix openssh
nixos-rebuild nix
]; nixos-rebuild
script = '' ];
[[ ! -d '/root/nixconf' ]] && cd /root && git clone git@github.com:itepastra/nixconf script = ''
cd /root/nixconf [[ ! -d '/root/nixconf' ]] && cd /root && git clone git@github.com:itepastra/nixconf
git pull cd /root/nixconf
nix flake update --commit-lock-file /root/nixconf git pull
nixos-rebuild switch --flake . nix flake update --commit-lock-file /root/nixconf
git push nixos-rebuild switch --flake .
''; git push
serviceConfig = { '';
Type = "oneshot"; serviceConfig = {
User = "root"; Type = "oneshot";
User = "root";
};
wants = [
"network-online.target"
];
after = [
"network-online.target"
];
};
}; };
wants = [
"network-online.target"
];
after = [
"network-online.target"
];
}; };
environment.etc = { environment.etc = {