Skip to content

Instantly share code, notes, and snippets.

@zmej420
Last active May 25, 2023 16:19
Show Gist options
  • Save zmej420/5719367a9788ddd659db7c8c0107ed37 to your computer and use it in GitHub Desktop.
Save zmej420/5719367a9788ddd659db7c8c0107ed37 to your computer and use it in GitHub Desktop.
# Run histdb-sync as zmej420 every hour to share zsh history across my machines
{
systemd = {
user.timers = {
histdb-sync = {
wantedBy = ["default.target"];
unitConfig = {
Description = "sync zsh histdb";
Requires = ["network-online.target"];
};
timerConfig = {
OnCalendar = ["*:00"];
};
};
};
user.services = {
histdb-sync = {
unitConfig = {
Description = "sync zsh histdb";
ConditionUser = "zmej420";
Requires = "network-online.target";
};
serviceConfig = {
Environment = "PATH=/run/current-system/sw/bin";
ExecStart = "/run/current-system/sw/bin/zsh --login --interactive -c histdb-sync";
};
};
};
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment