diff --git a/home/home.nix b/home/home.nix index 0db3666..27948c9 100644 --- a/home/home.nix +++ b/home/home.nix @@ -24,6 +24,7 @@ in { ./programs/zsh ./services/git-maintenance.nix + ./services/nix-channel-update.nix ./modules/colors.nix ./modules/shellAliases.nix diff --git a/home/services/nix-channel-update.nix b/home/services/nix-channel-update.nix new file mode 100644 index 0000000..9eb43a7 --- /dev/null +++ b/home/services/nix-channel-update.nix @@ -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"; + }; + }; +}