2020-08-10 23:45:26 +02:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
2021-06-24 12:22:58 +02:00
|
|
|
with pkgs;
|
|
|
|
|
2023-01-04 12:54:58 +01:00
|
|
|
{
|
2022-09-26 16:32:49 +02:00
|
|
|
# Upgrade Doom Emacs daily
|
2020-08-10 23:45:26 +02:00
|
|
|
systemd.user.services.doom-upgrade = {
|
|
|
|
description = "Upgrade Doom Emacs";
|
2021-06-24 12:22:58 +02:00
|
|
|
path = [ bash emacs-vterm git coreutils ];
|
2020-12-01 14:45:07 +01:00
|
|
|
script = ''
|
2022-06-21 22:58:36 +02:00
|
|
|
${pkgs.bash}/bin/bash -c "/home/coolneng/.emacs.d/bin/doom -! upgrade"
|
2020-12-01 14:45:07 +01:00
|
|
|
'';
|
2021-04-14 16:59:17 +02:00
|
|
|
serviceConfig.Type = "oneshot";
|
2022-09-26 16:32:49 +02:00
|
|
|
startAt = "22:00:00";
|
2022-06-02 22:48:10 +02:00
|
|
|
after = [ "network-online.target" ];
|
2020-08-10 23:45:26 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
# Upgrade Neovim plugins weekly
|
|
|
|
systemd.user.services.vim-plug-upgrade = {
|
|
|
|
description = "Upgrade Vim-Plug";
|
2021-08-09 02:11:33 +02:00
|
|
|
path = [ git neovim ];
|
2020-12-01 02:02:23 +01:00
|
|
|
script = "${pkgs.neovim}/bin/nvim +PlugUpgrade +PlugUpdate +qa";
|
2021-04-14 16:59:17 +02:00
|
|
|
serviceConfig.Type = "oneshot";
|
2021-04-29 16:46:14 +02:00
|
|
|
startAt = "Wed 18:00:00";
|
2022-06-02 22:48:10 +02:00
|
|
|
after = [ "network-online.target" ];
|
2020-08-10 23:45:26 +02:00
|
|
|
};
|
|
|
|
|
2021-04-29 16:46:14 +02:00
|
|
|
# Push password-store changes to git daily
|
2021-04-14 18:33:53 +02:00
|
|
|
systemd.user.services.password-store-push = {
|
|
|
|
description = "Push password-store changes to git";
|
2021-08-09 02:11:33 +02:00
|
|
|
path = [ pass-wayland git gitAndTools.pass-git-helper ];
|
2021-04-14 18:33:53 +02:00
|
|
|
script = "${pkgs.pass-wayland}/bin/pass git push";
|
|
|
|
serviceConfig.Type = "oneshot";
|
2021-04-29 16:46:14 +02:00
|
|
|
startAt = "18:00:00";
|
2022-06-02 22:48:10 +02:00
|
|
|
after = [ "network-online.target" ];
|
2021-04-14 18:33:53 +02:00
|
|
|
};
|
|
|
|
|
2021-06-18 16:26:51 +02:00
|
|
|
# Sync mail using IDLE
|
2021-09-21 23:34:00 +02:00
|
|
|
systemd.user.services.goimapnotify-ugent = {
|
|
|
|
description = "Sync UGent mail using IMAP IDLE";
|
2021-06-18 16:26:51 +02:00
|
|
|
wantedBy = [ "default.target" ];
|
2022-09-18 20:26:50 +02:00
|
|
|
path = [
|
|
|
|
goimapnotify
|
|
|
|
pass-wayland
|
|
|
|
isync-oauth2
|
|
|
|
mu
|
|
|
|
python39
|
|
|
|
gnupg
|
|
|
|
nix
|
|
|
|
procps
|
|
|
|
emacs-vterm
|
|
|
|
];
|
2021-06-18 16:26:51 +02:00
|
|
|
script = ''
|
2021-09-21 23:34:00 +02:00
|
|
|
${pkgs.goimapnotify}/bin/goimapnotify -conf /home/coolneng/.config/goimapnotify/ugent.conf
|
2021-06-18 16:26:51 +02:00
|
|
|
'';
|
2021-06-20 17:24:19 +02:00
|
|
|
serviceConfig = {
|
2022-03-23 13:02:50 +01:00
|
|
|
ExecStartPre = "/home/coolneng/.local/share/scripts/mail-sync ugent";
|
2021-06-20 17:24:19 +02:00
|
|
|
Type = "simple";
|
|
|
|
Restart = "always";
|
|
|
|
RestartSec = 20;
|
|
|
|
};
|
2022-06-02 22:48:10 +02:00
|
|
|
after = [ "network-online.target" ];
|
2021-06-18 16:26:51 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
systemd.user.services.goimapnotify-gmail = {
|
|
|
|
description = "Sync gmail mail using IMAP IDLE";
|
|
|
|
wantedBy = [ "default.target" ];
|
2022-09-18 20:26:50 +02:00
|
|
|
path = [ goimapnotify pass-wayland isync-oauth2 mu procps emacs-vterm ];
|
2021-06-18 16:26:51 +02:00
|
|
|
script = ''
|
|
|
|
${pkgs.goimapnotify}/bin/goimapnotify -conf /home/coolneng/.config/goimapnotify/gmail.conf
|
|
|
|
'';
|
2021-06-20 17:24:19 +02:00
|
|
|
serviceConfig = {
|
2022-03-23 13:02:50 +01:00
|
|
|
ExecStartPre = "/home/coolneng/.local/share/scripts/mail-sync gmail";
|
2021-06-20 17:24:19 +02:00
|
|
|
Type = "simple";
|
|
|
|
Restart = "always";
|
2022-04-12 00:33:58 +02:00
|
|
|
RestartSec = 20;
|
|
|
|
};
|
2022-06-02 22:48:10 +02:00
|
|
|
after = [ "network-online.target" ];
|
2022-04-12 00:33:58 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
systemd.user.services.goimapnotify-disroot = {
|
|
|
|
description = "Sync disroot mail using IMAP IDLE";
|
|
|
|
wantedBy = [ "default.target" ];
|
2022-09-18 20:26:50 +02:00
|
|
|
path = [ goimapnotify pass-wayland isync-oauth2 mu procps emacs-vterm ];
|
2022-04-12 00:33:58 +02:00
|
|
|
script = ''
|
|
|
|
${pkgs.goimapnotify}/bin/goimapnotify -conf /home/coolneng/.config/goimapnotify/disroot.conf
|
|
|
|
'';
|
|
|
|
serviceConfig = {
|
|
|
|
ExecStartPre = "/home/coolneng/.local/share/scripts/mail-sync disroot";
|
|
|
|
Type = "simple";
|
|
|
|
Restart = "always";
|
2021-06-20 17:24:19 +02:00
|
|
|
RestartSec = 20;
|
|
|
|
};
|
2022-06-02 22:48:10 +02:00
|
|
|
after = [ "network-online.target" ];
|
2021-06-18 16:26:51 +02:00
|
|
|
};
|
2022-01-19 16:06:50 +01:00
|
|
|
|
2022-09-24 12:43:43 +02:00
|
|
|
# Do a full mail sync periodically
|
|
|
|
systemd.user.services.periodic-mail-sync = {
|
|
|
|
description = "Run a mail sync operation periodically";
|
|
|
|
wantedBy = [ "default.target" ];
|
|
|
|
path =
|
|
|
|
[ pass-wayland isync-oauth2 mu procps emacs-vterm python39 gnupg nix ];
|
|
|
|
script = ''
|
|
|
|
/home/coolneng/.local/share/scripts/mail-sync -a
|
|
|
|
'';
|
|
|
|
after = [ "network-online.target" ];
|
|
|
|
startAt = "*-*-* *:00,15,30,45:00";
|
|
|
|
};
|
|
|
|
|
2022-03-29 13:18:47 +02:00
|
|
|
# HACK Change home partition permissions for mopidy
|
|
|
|
systemd.services.chmod-home = {
|
|
|
|
description = "Change home partition permissions for Mopidy";
|
|
|
|
wantedBy = [ "default.target" ];
|
|
|
|
script = "chmod 751 /home/coolneng";
|
|
|
|
serviceConfig.Type = "oneshot";
|
|
|
|
after = [ "home-coolneng.mount" ];
|
|
|
|
before = [ "mopidy.service" "mopidy-scan.service" ];
|
|
|
|
};
|
2022-05-02 00:46:17 +02:00
|
|
|
|
|
|
|
# Push panacea changes to git daily
|
|
|
|
systemd.user.services.panacea-push = {
|
|
|
|
description = "Push panacea changes to git";
|
2022-05-10 23:36:52 +02:00
|
|
|
path = [ pass-wayland git gitAndTools.pass-git-helper ];
|
|
|
|
script = "${pkgs.git}/bin/git -C /home/coolneng/Projects/panacea push";
|
2022-05-02 00:46:17 +02:00
|
|
|
serviceConfig.Type = "oneshot";
|
|
|
|
startAt = "14:00:00";
|
2022-06-02 22:48:10 +02:00
|
|
|
after = [ "network-online.target" ];
|
2022-05-02 00:46:17 +02:00
|
|
|
};
|
2022-06-13 12:21:55 +02:00
|
|
|
|
2022-06-20 22:52:06 +02:00
|
|
|
# Pull changes from zion daily
|
|
|
|
systemd.user.services.zion-pull = {
|
|
|
|
description = "Pull zion changes to git";
|
|
|
|
path = [ git ];
|
|
|
|
script = "${pkgs.git}/bin/git -C /home/coolneng/Projects/zion pull";
|
|
|
|
serviceConfig.Type = "oneshot";
|
|
|
|
startAt = "10:00:00";
|
|
|
|
after = [ "network-online.target" ];
|
|
|
|
};
|
2020-08-10 23:45:26 +02:00
|
|
|
}
|