From 199e7b42b8bc8840689a9bc56eede44ff8f9f8f5 Mon Sep 17 00:00:00 2001 From: caley <195605706+cqley@users.noreply.github.com> Date: Sun, 12 Jul 2026 15:52:56 +0200 Subject: Create obsidian.nix --- nixos/mdls/obsidian.nix | 76 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 nixos/mdls/obsidian.nix diff --git a/nixos/mdls/obsidian.nix b/nixos/mdls/obsidian.nix new file mode 100644 index 0000000..b6c8ec0 --- /dev/null +++ b/nixos/mdls/obsidian.nix @@ -0,0 +1,76 @@ +{ config, pkgs, ... }: + +{ + home.file = { + ".documents/obsidian/.obsidian/app.json".text = builtins.toJSON { + readableLineLength = true; + foldHeading = true; + showLineNumber = true; + spellcheck = false; + vimMode = false; + newFileLocation = "current"; + promptDelete = false; + }; + ".documents/obsidian/.obsidian/appearance.json".text = builtins.toJSON { + accentColor = "#ffa8db"; + cssTheme = ""; + theme = "obsidian"; + }; + ".documents/obsidian/.obsidian/core-plugins.json".text = builtins.toJSON { + "file-explorer" = true; + "global-search" = true; + "switcher" = false; + "graph" = true; + "backlink" = false; + "canvas" = false; + "outgoing-link" = true; + "tag-pane" = true; + "footnotes" = false; + "properties" = false; + "page-preview" = true; + "daily-notes" = true; + "templates" = false; + "note-composer" = false; + "command-palette" = false; + "slash-command" = false; + "editor-status" = true; + "bookmarks" = false; + "markdown-importer" = false; + "zk-prefixer" = false; + "random-note" = false; + "outline" = true; + "word-count" = true; + "slides" = false; + "audio-recorder" = false; + "workspaces" = false; + "file-recovery" = true; + "publish" = false; + "sync" = false; + "bases" = false; + "webviewer" = false; + }; + }; + + systemd.user.services.obsidian = { + Unit.Description = "obsidian git sync"; + Service = { + ExecStart = "${pkgs.writeShellScript "obsidian" '' + while true; do + cd /home/cat/.documents/obsidian || exit 1 + if [ ! -d .git ]; then + exit 1 + fi + git add . + if ! git diff-index --quiet HEAD; then + git commit -m "sync $(date +'%Y-%m-%d %H:%M:%S')" + git pull --rebase origin main + git push origin main + fi + sleep 60 + done + ''}"; + Restart = "always"; + }; + Install.WantedBy = [ "default.target" ]; + }; +} -- cgit v1.3.1