home: add timer for updating nix channels

This commit is contained in:
Oystein Kristoffer Tveit 2024-08-05 16:37:17 +02:00
parent 5b8500ba96
commit 93e01222a9
Signed by: oysteikt
GPG Key ID: 9F2F7D8250F35146
2 changed files with 31 additions and 0 deletions

View File

@ -24,6 +24,7 @@ in {
./programs/zsh ./programs/zsh
./services/git-maintenance.nix ./services/git-maintenance.nix
./services/nix-channel-update.nix
./modules/colors.nix ./modules/colors.nix
./modules/shellAliases.nix ./modules/shellAliases.nix

View File

@ -0,0 +1,30 @@
{ config, lib, ... }:
{
# TODO: make these units run per channel
systemd.user.timers.update-nix-channels = {
Unit = {
Description = "Update nix channels";
};
Timer = {
Unit = "update-nix-channels.service";
OnCalendar = "daily";
Persistent = true;
};
Install = {
WantedBy = [ "timers.target" ];
};
};
systemd.user.services.update-nix-channels = {
Unit = {
Description = "Update nix channels";
};
Service = {
Type = "oneshot";
ExecStart = "${config.nix.package}/bin/nix-channel --update --verbose";
};
};
}