2025-08-08 22:10:47 -04:00
|
|
|
{ config, home-manager-unstable, pkgs, ...}: {
|
2025-07-30 08:29:27 -04:00
|
|
|
home.packages = with pkgs; [
|
|
|
|
obsidian
|
|
|
|
obsidian-export
|
|
|
|
];
|
2025-08-08 22:10:47 -04:00
|
|
|
programs.obsidian = {
|
|
|
|
enable = true;
|
|
|
|
package =
|
|
|
|
vaults = {
|
|
|
|
"notes" = {
|
|
|
|
enable = true;
|
|
|
|
target = "${config.home.homeDirectory}/Documents/obsidian/notes";
|
|
|
|
};
|
|
|
|
"work-notes" = {
|
|
|
|
enable = true;
|
|
|
|
target = "${config.home.homeDirectory}/Documents/obsidian/work-notes";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
# defaultSettings = {
|
|
|
|
# themes = [ "catppuccin" ];
|
|
|
|
# };
|
|
|
|
};
|
2025-07-30 08:29:27 -04:00
|
|
|
|
|
|
|
home.activation.obsidianRepos = config.lib.dag.entryAfter ["writeBoundary"] ''
|
|
|
|
REPOS_DIR="${config.home.homeDirectory}/Documents/obsidian"
|
|
|
|
|
|
|
|
# Create the repos directory if it doesn't exist
|
|
|
|
mkdir -p "$REPOS_DIR"
|
|
|
|
|
|
|
|
# Function to clone or update a repository
|
|
|
|
clone_or_update() {
|
|
|
|
local repo_url="$1"
|
|
|
|
local vault_name="$2"
|
|
|
|
local vault_path="$REPOS_DIR/$vault_name"
|
|
|
|
|
|
|
|
if [ -d "$vault_path/.git" ]; then
|
|
|
|
echo "Updating existing vault: $vault_name"
|
|
|
|
cd "$vault_path"
|
|
|
|
${pkgs.git}/bin/git pull origin main || ${pkgs.git}/bin/git pull origin master || true
|
|
|
|
else
|
|
|
|
echo "Cloning new vault: $vault_name"
|
|
|
|
rm -rf "$vault_path" # Remove if exists but not a git repo
|
|
|
|
${pkgs.git}/bin/git clone "$repo_url" "$vault_path" || true
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
# Clone repositories
|
|
|
|
clone_or_update "https://scm.wyattjmiller.com/NoteFolio/notes.git" "notes"
|
|
|
|
clone_or_update "https://scm.wyattjmiller.com/NoteFolio/work-notes.git" "work-notes"
|
|
|
|
|
|
|
|
echo "Obsidian repository vaults setup complete in $REPOS_DIR"
|
|
|
|
'';
|
|
|
|
}
|