panacea/modules/periodic.nix

64 lines
1.7 KiB
Nix
Raw Normal View History

2020-08-10 23:45:26 +02:00
{ config, lib, pkgs, ... }:
{
# Upgrade Doom Emacs daily
systemd.user.services.doom-upgrade = {
description = "Upgrade Doom Emacs";
wantedBy = [ "default.target" ];
path = with pkgs; [ bash emacsGccPgtk git coreutils ];
script =
"${pkgs.bash}/bin/bash -c '/home/coolneng/.emacs.d/bin/doom -y upgrade'";
serviceConfig = { Type = "oneshot"; };
2020-08-10 23:45:26 +02:00
};
systemd.user.timers.doom-upgrade = {
description = "Daily upgrade of Doom Emacs";
wantedBy = [ "default.target" ];
timerConfig = {
OnCalendar = "20:00:00";
Unit = "doom-upgrade.service";
};
};
# Clean up Doom Emacs monthly
systemd.user.services.doom-purge = {
description = "Purge Doom Emacs";
wantedBy = [ "default.target" ];
path = with pkgs; [ bash emacsGccPgtk git coreutils ];
script =
"${pkgs.bash}/bin/bash -c '/home/coolneng/.emacs.d/bin/doom -y purge'";
serviceConfig = { Type = "oneshot"; };
2020-08-10 23:45:26 +02:00
};
systemd.user.timers.doom-purge = {
description = "Monthly purge of Doom Emacs";
wantedBy = [ "default.target" ];
timerConfig = {
OnCalendar = "13 22:00:00";
Unit = "doom-purge.service";
};
};
# Upgrade Neovim plugins weekly
systemd.user.services.vim-plug-upgrade = {
description = "Upgrade Vim-Plug";
wantedBy = [ "default.target" ];
path = [ pkgs.git pkgs.neovim ];
serviceConfig = {
Type = "oneshot";
ExecStart = "${pkgs.neovim}/bin/nvim +PlugUpgrade +PlugUpdate +qa";
};
};
systemd.user.timers.vim-plug-upgrade = {
description = "Weekly upgrade of Vim-Plug";
wantedBy = [ "default.target" ];
timerConfig = {
OnCalendar = "Wed 18:00:00";
Unit = "vim-plug-upgrade.service";
};
};
}