{ lib, stdenvNoCC, fetchurl, writeText, }: let # Helper to build an Obsidian plugin from pre-built GitHub release assets. # The home-manager module expects a package with manifest.json at the root. buildObsidianPlugin = { pname, version, owner, repo, mainJs, manifestJson, stylesCSS ? null, meta ? { }, }: stdenvNoCC.mkDerivation { inherit pname version; dontUnpack = true; installPhase = '' mkdir -p $out cp ${mainJs} $out/main.js cp ${manifestJson} $out/manifest.json '' + lib.optionalString (stylesCSS != null) '' cp ${stylesCSS} $out/styles.css ''; meta = { platforms = lib.platforms.all; } // meta; }; # Helper to build an Obsidian theme. # Themes need manifest.json and theme.css at the root. buildObsidianTheme = { pname, version, themeCSS, manifestJson, meta ? { }, }: stdenvNoCC.mkDerivation { inherit pname version; dontUnpack = true; installPhase = '' mkdir -p $out cp ${manifestJson} $out/manifest.json cp ${themeCSS} $out/theme.css ''; meta = { platforms = lib.platforms.all; } // meta; }; in { obsidian-linter = buildObsidianPlugin { pname = "obsidian-linter"; version = "1.31.0"; owner = "platers"; repo = "obsidian-linter"; mainJs = fetchurl { url = "https://github.com/platers/obsidian-linter/releases/download/1.31.0/main.js"; sha256 = "19k38qlm4g6jw4baqidyjs64aw3vlm01v9gz1f1dpn828csz8xiv"; }; manifestJson = fetchurl { url = "https://github.com/platers/obsidian-linter/releases/download/1.31.0/manifest.json"; sha256 = "0isjnpmsv6a0i1bj7rndwaafg5wp3ch7dxlvq49mbfw424dz76hm"; }; stylesCSS = fetchurl { url = "https://github.com/platers/obsidian-linter/releases/download/1.31.0/styles.css"; sha256 = "1nr27i0lvmxdzvgkzm8qwbcb4h4zmvyarc9kqk3msi590n5m1kqc"; }; meta.description = "Formats and styles your notes with configurable linting rules"; }; quickadd = buildObsidianPlugin { pname = "quickadd"; version = "2.11.0"; owner = "chhoumann"; repo = "quickadd"; mainJs = fetchurl { url = "https://github.com/chhoumann/quickadd/releases/download/2.11.0/main.js"; sha256 = "0my0zmk0yx1gls35rgn614m8zfbks962kd701fvb95xdvlqmdjc2"; }; manifestJson = fetchurl { url = "https://github.com/chhoumann/quickadd/releases/download/2.11.0/manifest.json"; sha256 = "02ky8jj6z8anxmsgmnxcsmigg936ddhphbpf2ags3l3sr48ic5fw"; }; stylesCSS = fetchurl { url = "https://github.com/chhoumann/quickadd/releases/download/2.11.0/styles.css"; sha256 = "1vrkwak5k7w8819viw0qdc2yl4p2kgs73xaykac0k2885wqxd0vp"; }; meta.description = "Quickly add new pages or content to your vault"; }; recent-files-obsidian = buildObsidianPlugin { pname = "recent-files-obsidian"; version = "1.7.6"; owner = "tgrosinger"; repo = "recent-files-obsidian"; mainJs = fetchurl { url = "https://github.com/tgrosinger/recent-files-obsidian/releases/download/1.7.6/main.js"; sha256 = "0awn6r451apl1z46wdbr4s4npngd8cga2qyzyp36gfa7ykvsaajl"; }; manifestJson = fetchurl { url = "https://github.com/tgrosinger/recent-files-obsidian/releases/download/1.7.6/manifest.json"; sha256 = "02q69wd16gygqr3z7bdzkk4qpi13d8w80jqr7ji7gam3mhs3s6ki"; }; stylesCSS = fetchurl { url = "https://github.com/tgrosinger/recent-files-obsidian/releases/download/1.7.6/styles.css"; sha256 = "1nrxrcr0h2vrwxg0dj64f99yifvnlrxnyqh938i4if0bmf99rr1f"; }; meta.description = "List files by most recently opened"; }; periodic-notes = buildObsidianPlugin { pname = "periodic-notes"; version = "0.0.17"; owner = "liamcain"; repo = "obsidian-periodic-notes"; mainJs = fetchurl { url = "https://github.com/liamcain/obsidian-periodic-notes/releases/download/0.0.17/main.js"; sha256 = "03lb3ydw5p6xh7gm642x8bzfvr93knpw653nzhv10gb9ff3a3wfc"; }; manifestJson = fetchurl { url = "https://github.com/liamcain/obsidian-periodic-notes/releases/download/0.0.17/manifest.json"; sha256 = "17042hj7zrm7x4sldl0l95blpzlpbf13b4s8vb5kyfsxywir78mx"; }; stylesCSS = fetchurl { url = "https://github.com/liamcain/obsidian-periodic-notes/releases/download/0.0.17/styles.css"; sha256 = "0f322kmq8h08amq22wgvi5lcwfkvzdpa9n155vnh0jf8sj2kjgv1"; }; meta.description = "Create/manage your daily, weekly, and monthly notes"; }; obsidian-vimrc-support = buildObsidianPlugin { pname = "obsidian-vimrc-support"; version = "0.10.2"; owner = "esm7"; repo = "obsidian-vimrc-support"; mainJs = fetchurl { url = "https://github.com/esm7/obsidian-vimrc-support/releases/download/0.10.2/main.js"; sha256 = "1qkc9rrh92hy5cbm0vqy4zbgccn53f1cll220mg51wpf35776qv8"; }; manifestJson = fetchurl { url = "https://github.com/esm7/obsidian-vimrc-support/releases/download/0.10.2/manifest.json"; sha256 = "0mnh4yz53zx7lsyqpl4zjy3sb48l5mb83qw9jayqxf4iwd5mmpmj"; }; meta.description = "Auto-load a startup file with Obsidian Vim commands"; }; obsidian-front-matter-title-plugin = buildObsidianPlugin { pname = "obsidian-front-matter-title-plugin"; version = "3.13.1"; owner = "Snezhig"; repo = "obsidian-front-matter-title"; mainJs = fetchurl { url = "https://github.com/Snezhig/obsidian-front-matter-title/releases/download/3.13.1/main.js"; sha256 = "0azbj27xyx8g3n7iyc481ndp9q1nqh6g7p34ngg892xc880a9gkn"; }; manifestJson = fetchurl { url = "https://github.com/Snezhig/obsidian-front-matter-title/releases/download/3.13.1/manifest.json"; sha256 = "0kbs75d0xs19cmhs3kpmd48wk5832z1krdlw1hv998ararj9ww6q"; }; meta.description = "Display frontmatter title instead of filename in explorer, graph, etc."; }; obsidian-atmosphere = buildObsidianPlugin { pname = "obsidian-atmosphere"; version = "0.1.19"; owner = "treethought"; repo = "obsidian-atmosphere"; mainJs = fetchurl { url = "https://github.com/treethought/obsidian-atmosphere/releases/download/0.1.19/main.js"; sha256 = "0ab2lzclbjzyprlar68qyx8cpbyfmxzpc4slrp0yp9f6yhz4pn91"; }; manifestJson = fetchurl { url = "https://github.com/treethought/obsidian-atmosphere/releases/download/0.1.19/manifest.json"; sha256 = "0qrfdz6xwl8jgbdkqsaxgk5jma1xna5xa1m3jcnlwmbsk6gnf7i8"; }; stylesCSS = fetchurl { url = "https://github.com/treethought/obsidian-atmosphere/releases/download/0.1.19/styles.css"; sha256 = "09022ykg2wipjkq8ysjkq4js5prhm8ll0kcsz1359xs45s06ajym"; }; meta.description = "Ambient weather and nature effects for Obsidian"; }; # Ayu Mirage theme # The upstream repo (bcdavasconcelos/Obsidian-Ayu_Mirage) uses the legacy # format (obsidian.css). We fetch it and provide the manifest.json that # Obsidian generated when installing it. ayu-mirage = buildObsidianTheme { pname = "ayu-mirage"; version = "0.0.0"; themeCSS = fetchurl { url = "https://raw.githubusercontent.com/bcdavasconcelos/Obsidian-Ayu_Mirage/master/obsidian.css"; sha256 = "0hcsgc8vlj0r2nwl1l4cvi9rr72m2aifyd3g538l0qrk5l6b1dqv"; }; manifestJson = writeText "manifest.json" ( builtins.toJSON { name = "Ayu Mirage"; version = "0.0.0"; minAppVersion = "0.16.0"; author = "bernardo_v"; } ); meta.description = "Ayu Mirage dark theme for Obsidian"; }; }