Move git-sync home config to shared module

This commit is contained in:
2026-04-26 20:55:15 -07:00
parent 9c2f244309
commit c3c0d54da4
3 changed files with 42 additions and 29 deletions

View File

@@ -0,0 +1,37 @@
{
config,
lib,
pkgs,
...
}: let
gitSyncPackage =
if pkgs ? "git-sync-rs"
then pkgs."git-sync-rs"
else pkgs.git-sync;
orgPath = "${config.home.homeDirectory}/org";
passwordStorePath = "${config.home.homeDirectory}/.password-store";
in {
services.git-sync = {
enable = true;
package = gitSyncPackage;
repositories = {
org = {
path = orgPath;
uri = "git@github.com:colonelpanic8/org.git";
interval = 180;
};
password-store = {
path = passwordStorePath;
uri = "git@github.com:colonelpanic8/.password-store.git";
};
};
};
# git-sync-rs does not infer the repository from launchd's WorkingDirectory.
launchd.agents = {
git-sync-org.config.ProgramArguments =
lib.mkForce ["${gitSyncPackage}/bin/git-sync" "-d" orgPath];
git-sync-password-store.config.ProgramArguments =
lib.mkForce ["${gitSyncPackage}/bin/git-sync" "-d" passwordStorePath];
};
}

View File

@@ -1,24 +0,0 @@
{
config,
pkgs,
...
}: {
services.git-sync = {
enable = true;
package =
if pkgs ? "git-sync-rs"
then pkgs."git-sync-rs"
else pkgs.git-sync;
repositories = {
org = {
path = "${config.home.homeDirectory}/org";
uri = "git@github.com:colonelpanic8/org.git";
interval = 180;
};
password-store = {
path = "${config.home.homeDirectory}/.password-store";
uri = "git@github.com:IvanMalison/.password-store.git";
};
};
};
}