feat: enable auto update system service

This commit is contained in:
Ananth Venkatesh 2025-05-06 01:43:40 -04:00
parent 099e29e327
commit 47f4aa7799
No known key found for this signature in database
GPG key ID: 4BB578E748CFE4FF
6 changed files with 119 additions and 34 deletions

View file

@ -66,6 +66,22 @@
ExecStart = "/nix/var/nix/profiles/system/bin/switch-to-configuration test";
};
};
refresh = let
flakeLocation = "/home/youwen/.config/liminalOS";
in {
description = "Automatically update liminalOS";
after = [ "network-online.target" ];
requires = [ "network-online.target" ];
script = ''
cd ${flakeLocation}
${pkgs.git}/bin/git config --global --add safe.directory ${flakeLocation}
${pkgs.git}/bin/git pull
'';
serviceConfig = {
Environment = "HOME=/root";
};
wantedBy = [ ];
};
};
systemd.timers = {
colorscheme-dawn = {
@ -86,6 +102,15 @@
Unit = "colorscheme-dusk.service";
};
};
refresh = {
description = "Schedule daily system updates";
wantedBy = [ "timers.target" ];
timerConfig = {
OnCalendar = "daily";
Persistent = true;
Unit = "refresh.service";
};
};
};
security.polkit.extraConfig = ''