Move git-sync home config to shared module
This commit is contained in:
@@ -85,8 +85,10 @@
|
|||||||
enabledHomeUsers = [
|
enabledHomeUsers = [
|
||||||
activePrimaryUser
|
activePrimaryUser
|
||||||
];
|
];
|
||||||
sharedHomeModules = [./home/common.nix];
|
sharedHomeModules = [
|
||||||
ivanHomeModules = [./home/ivan.nix];
|
./home/common.nix
|
||||||
|
./home/git-sync.nix
|
||||||
|
];
|
||||||
homeForUser = user: "/Users/${user}";
|
homeForUser = user: "/Users/${user}";
|
||||||
configuration = {
|
configuration = {
|
||||||
pkgs,
|
pkgs,
|
||||||
@@ -374,9 +376,7 @@
|
|||||||
inherit inputs libDir;
|
inherit inputs libDir;
|
||||||
};
|
};
|
||||||
sharedModules = sharedHomeModules;
|
sharedModules = sharedHomeModules;
|
||||||
users = lib.genAttrs enabledHomeUsers (_: {
|
users = lib.genAttrs enabledHomeUsers (_: {});
|
||||||
imports = ivanHomeModules;
|
|
||||||
});
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
in {
|
in {
|
||||||
|
|||||||
37
nix-darwin/home/git-sync.nix
Normal file
37
nix-darwin/home/git-sync.nix
Normal 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];
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -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";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user