sync config

This commit is contained in:
2025-03-17 00:25:30 +01:00
parent e0429c9081
commit c508e290c7

View File

@@ -10,10 +10,35 @@
imports = [ ./remote.nix ];
# TODO:
#.config/zed/keymap.json
#.config/zed/settings.json
#.config/zed/themes
#.config/zed/snippets
systemd.user.services."update-zed-config" = {
Unit.Description = "Autoupdate zed config";
Service.Type = "oneshot";
Service.ExecStart = toString (
# TODO: do I want to clone it if missing? Requires git keys, I should clone on OnActiveSec
pkgs.writers.writeBash "update-zed-config" { } ''
PATH="${lib.makeBinPath [ pkgs.git ]}''${PATH:-":$PATH"}"
if [[ -e "$HOME".config/zed/.git ]]; then
cd "$HOME".config/zed/
git add .
if ! git diff --staged --exit-code --quiet; then
git commit -m "Daily auto-commit $(date -u +%Y-%m-%dT%H:%M:%S%Z) @ $(hostname)"
fi
git pull --rebase --autostash
git push
fi
''
);
};
systemd.user.timers."update-zed-config" = {
Unit.Description = "Autoupdate zed config";
Install.WantedBy = [ "timers.target" ];
# https://www.man7.org/linux/man-pages/man5/systemd.timer.5.html
# Timer.OnBootSec = "10m";
# Timer.OnUnitActiveSec = "24h";
# Timer.Persistent = true; # will remember to do a thing on boot if timer was missed while off
Timer.OnCalendar = "06:00";
Timer.RandomizedDelaySec = "45min";
Timer.Unit = "update-zed-config.service";
};
}