From 97f475f131f909884ca4025af0d28115215a4945 Mon Sep 17 00:00:00 2001 From: DerGrumpf Date: Sun, 31 May 2026 16:17:47 +0200 Subject: [PATCH] WIP: Nixifyng Floorp, Problems arise from setting Plugins on standard Enable; Solved: Obsidian Notes Vault now getting pulled as default --- home/floorp/default.nix | 2 ++ home/obsidian.nix | 47 ++++++++++++++++++++++++++++++++++++++--- 2 files changed, 46 insertions(+), 3 deletions(-) diff --git a/home/floorp/default.nix b/home/floorp/default.nix index 4acd85c..9fc491f 100644 --- a/home/floorp/default.nix +++ b/home/floorp/default.nix @@ -104,4 +104,6 @@ in ]; }; }; + + home.file.".floorp/default/containers.json".source = ./sideberry.json; } diff --git a/home/obsidian.nix b/home/obsidian.nix index e5e84e5..bd3066d 100644 --- a/home/obsidian.nix +++ b/home/obsidian.nix @@ -1,4 +1,45 @@ -_: { - # TODO: Add Automatic Vault pull and detection - programs.obsidian.enable = true; +{ + config, + pkgs, + lib, + ... +}: +let + vaultRepo = "ssh://gitea@git.cyperpunk.de:12222/DerGrumpf/Notes.git"; + vaultPath = "${config.home.homeDirectory}/Notes"; + sshBinary = "${pkgs.openssh}/bin/ssh"; + gitBin = "${pkgs.git}/bin"; + gitLfsBin = "${pkgs.git-lfs}/bin"; +in +{ + programs.obsidian = { + enable = true; + vaults.notes = { + target = "Notes"; + settings = { }; + }; + }; + + home.packages = with pkgs; [ + git + git-lfs + openssh + ]; + + home.activation.obsidianVault = lib.hm.dag.entryAfter [ "writeBoundary" ] '' + export PATH="${gitBin}:${gitLfsBin}:$PATH" + export GIT_SSH_COMMAND="${sshBinary} -o StrictHostKeyChecking=accept-new" + export GIT_LFS_SKIP_SMUDGE=1 + + if [ ! -d "${vaultPath}/.git" ]; then + echo "Cloning Obsidian vault (LFS objects will be pulled separately)..." + ${gitBin}/git clone "${vaultRepo}" "${vaultPath}" + ${gitLfsBin}/git-lfs install --local "${vaultPath}" + ${gitBin}/git -C "${vaultPath}" lfs pull + else + echo "Pulling latest changes for Obsidian vault..." + ${gitBin}/git -C "${vaultPath}" pull + ${gitBin}/git -C "${vaultPath}" lfs pull + fi + ''; }