this repo has no description
2
fork

Configure Feed

Select the types of activity you want to include in your feed.

add obsidian home-manager profile with vim config and community plugins

Configure Obsidian declaratively via the new home-manager programs.obsidian
module. Packages 5 community plugins (linter, quickadd, recent-files,
periodic-notes, vimrc-support) and the Ayu Mirage theme as nix derivations
fetched from GitHub releases. Shared defaultSettings across kitaab/markdown
(all machines) and usr/acreom/sourcegraph (darwin-only) vaults.

+858 -3
+2
flake.nix
··· 212 212 "vcv-rack" 213 213 "SunVox" 214 214 "renoise" 215 + "obsidian" 215 216 ]; 216 217 }; 217 218 overlays = [ ··· 421 422 useGlobalPkgs = true; 422 423 useUserPackages = true; 423 424 extraSpecialArgs = { inherit inputs; }; 425 + backupFileExtension = "hm-bak"; 424 426 }; 425 427 } 426 428 ];
+1
home/darwin/default.nix
··· 14 14 ../profiles/kitty 15 15 ../profiles/tmux 16 16 ../profiles/opencode 17 + ../profiles/obsidian 17 18 # ../profiles/firefox 18 19 ]; 19 20
+73
home/profiles/obsidian/.obsidian.vimrc
··· 1 + " ============================================================ 2 + " Obsidian Vimrc (requires Vimrc Support plugin by esm7) 3 + " ============================================================ 4 + 5 + " --- Clipboard --- 6 + " All yanks go to system clipboard 7 + set clipboard=unnamedplus 8 + 9 + " Make Y yank to end of line (consistent with C and D) 10 + nnoremap Y y$ 11 + 12 + " --- Unbind Space for use as leader --- 13 + unmap <Space> 14 + 15 + " --- Sidebar & Navigation --- 16 + " Toggle left sidebar 17 + exmap toggleSidebar obcommand app:toggle-left-sidebar 18 + nmap <Space>e :toggleSidebar<CR> 19 + 20 + " Reveal active file in file explorer 21 + exmap revealFile obcommand file-explorer:reveal-active-file 22 + nmap <Space>f :revealFile<CR> 23 + 24 + " Command palette 25 + exmap commandPalette obcommand command-palette:open 26 + nmap <Space>p :commandPalette<CR> 27 + 28 + " --- Tab Navigation --- 29 + " Next tab (matches Vim gt) 30 + exmap nextTab obcommand workspace:next-tab 31 + nmap gt :nextTab<CR> 32 + 33 + " Previous tab (matches Vim gT) 34 + exmap prevTab obcommand workspace:previous-tab 35 + nmap gT :prevTab<CR> 36 + 37 + " Close current tab 38 + exmap closeTab obcommand workspace:close 39 + nmap gd :closeTab<CR> 40 + 41 + " --- Notes --- 42 + " Daily note (Periodic Notes) 43 + exmap dailyNote obcommand periodic-notes:open-daily-note 44 + nmap <Space>d :dailyNote<CR> 45 + 46 + " Weekly note (Periodic Notes) 47 + exmap weeklyNote obcommand periodic-notes:open-weekly-note 48 + nmap <Space>w :weeklyNote<CR> 49 + 50 + " New Zettelkasten note 51 + exmap newZK obcommand zk-prefixer 52 + nmap <Space>zn :newZK<CR> 53 + 54 + " Split (QuickAdd macro) 55 + exmap splitNote obcommand quickadd:choice:1d350c80-9184-4f8a-b37e-4e7c0712a19f 56 + nmap <Space>zs :splitNote<CR> 57 + 58 + " --- Folding --- 59 + exmap unfoldAtCursor obcommand editor:unfold 60 + exmap foldAtCursor obcommand editor:fold 61 + exmap toggleFold obcommand editor:toggle-fold 62 + exmap unfoldAll obcommand editor:unfold-all 63 + exmap foldAll obcommand editor:fold-all 64 + 65 + nmap zo :unfoldAtCursor<CR> 66 + nmap zc :foldAtCursor<CR> 67 + nmap za :toggleFold<CR> 68 + nmap zR :unfoldAll<CR> 69 + nmap zM :foldAll<CR> 70 + 71 + " --- Quick Switcher --- 72 + exmap quickSwitcher obcommand switcher:open 73 + nmap <Space><Space> :quickSwitcher<CR>
+568
home/profiles/obsidian/default.nix
··· 1 + { 2 + pkgs, 3 + lib, 4 + ... 5 + }: 6 + 7 + let 8 + isDarwin = pkgs.stdenv.isDarwin; 9 + plugins = pkgs.obsidianPlugins; 10 + in 11 + { 12 + programs.obsidian = { 13 + enable = true; 14 + 15 + defaultSettings = { 16 + app = { 17 + vimMode = true; 18 + promptDelete = false; 19 + }; 20 + 21 + appearance = { }; 22 + 23 + corePlugins = [ 24 + # Shared across all vaults (union of kitaab + sourcegraph) 25 + "file-explorer" 26 + "global-search" 27 + "switcher" 28 + "graph" 29 + "backlink" 30 + "canvas" 31 + "outgoing-link" 32 + "tag-pane" 33 + "page-preview" 34 + "templates" 35 + "note-composer" 36 + "command-palette" 37 + "editor-status" 38 + "bookmarks" 39 + "outline" 40 + "word-count" 41 + "file-recovery" 42 + # From kitaab 43 + "properties" 44 + "daily-notes" 45 + "sync" 46 + # From sourcegraph 47 + "zk-prefixer" 48 + # NOTE: "bases" and "webviewer" are not yet in the home-manager 49 + # core plugins enum. They will need to be enabled manually in 50 + # Obsidian or added here once home-manager updates. 51 + # Core plugins with settings 52 + { 53 + name = "daily-notes"; 54 + settings = { 55 + format = "YYYYMMDD"; 56 + template = "zk-template"; 57 + }; 58 + } 59 + { 60 + name = "graph"; 61 + settings = { 62 + collapse-filter = true; 63 + search = ""; 64 + showTags = false; 65 + showAttachments = false; 66 + hideUnresolved = false; 67 + showOrphans = true; 68 + collapse-color-groups = true; 69 + colorGroups = [ ]; 70 + collapse-display = true; 71 + showArrow = false; 72 + textFadeMultiplier = 0; 73 + nodeSizeMultiplier = 1; 74 + lineSizeMultiplier = 1; 75 + collapse-forces = true; 76 + centerStrength = 0.518713248970312; 77 + repelStrength = 10; 78 + linkStrength = 1; 79 + linkDistance = 250; 80 + scale = 1; 81 + close = false; 82 + }; 83 + } 84 + { 85 + name = "zk-prefixer"; 86 + settings = { 87 + format = "YYMMDD-HHmm"; 88 + template = "zk-template"; 89 + }; 90 + } 91 + ]; 92 + 93 + communityPlugins = [ 94 + { 95 + pkg = plugins.obsidian-linter; 96 + settings = { 97 + ruleConfigs = { 98 + add-blank-line-after-yaml.enabled = false; 99 + dedupe-yaml-array-values = { 100 + enabled = false; 101 + dedupe-alias-key = true; 102 + dedupe-tag-key = true; 103 + dedupe-array-keys = true; 104 + ignore-keys = ""; 105 + }; 106 + escape-yaml-special-characters = { 107 + enabled = false; 108 + try-to-escape-single-line-arrays = false; 109 + }; 110 + force-yaml-escape = { 111 + enabled = false; 112 + force-yaml-escape-keys = ""; 113 + }; 114 + format-tags-in-yaml.enabled = false; 115 + format-yaml-array = { 116 + enabled = false; 117 + alias-key = true; 118 + tag-key = true; 119 + default-array-style = "single-line"; 120 + default-array-keys = true; 121 + force-single-line-array-style = ""; 122 + force-multi-line-array-style = ""; 123 + }; 124 + insert-yaml-attributes = { 125 + enabled = false; 126 + text-to-insert = ""; 127 + }; 128 + move-tags-to-yaml = { 129 + enabled = false; 130 + how-to-handle-existing-tags = "Nothing"; 131 + tags-to-ignore = ""; 132 + }; 133 + remove-yaml-keys = { 134 + enabled = false; 135 + yaml-keys-to-remove = ""; 136 + }; 137 + sort-yaml-array-values = { 138 + enabled = false; 139 + sort-alias-key = true; 140 + sort-tag-key = true; 141 + sort-array-keys = true; 142 + ignore-keys = ""; 143 + sort-order = "Ascending Alphabetical"; 144 + }; 145 + yaml-key-sort = { 146 + enabled = false; 147 + yaml-key-priority-sort-order = ""; 148 + priority-keys-at-start-of-yaml = true; 149 + yaml-sort-order-for-other-keys = "None"; 150 + }; 151 + yaml-timestamp = { 152 + enabled = true; 153 + date-created = false; 154 + date-created-key = "date"; 155 + date-created-source-of-truth = "file system"; 156 + date-modified = true; 157 + date-modified-key = "update"; 158 + date-modified-source-of-truth = "file system"; 159 + format = "YYMMDD-HHmm"; 160 + convert-to-utc = false; 161 + update-on-file-contents-updated = "never"; 162 + }; 163 + yaml-title = { 164 + enabled = false; 165 + title-key = "title"; 166 + mode = "first-h1-or-filename-if-h1-missing"; 167 + }; 168 + yaml-title-alias = { 169 + enabled = false; 170 + preserve-existing-alias-section-style = true; 171 + keep-alias-that-matches-the-filename = false; 172 + use-yaml-key-to-keep-track-of-old-filename-or-heading = true; 173 + alias-helper-key = "linter-yaml-title-alias"; 174 + }; 175 + capitalize-headings = { 176 + enabled = false; 177 + style = "Title Case"; 178 + ignore-case-words = true; 179 + ignore-words = "macOS, iOS, iPhone, iPad, JavaScript, TypeScript, AppleScript, I"; 180 + lowercase-words = ""; 181 + }; 182 + file-name-heading.enabled = false; 183 + header-increment = { 184 + enabled = false; 185 + start-at-h2 = false; 186 + }; 187 + headings-start-line.enabled = false; 188 + remove-trailing-punctuation-in-heading = { 189 + enabled = false; 190 + punctuation-to-remove = ".,;:!"; 191 + }; 192 + footnote-after-punctuation.enabled = false; 193 + move-footnotes-to-the-bottom = { 194 + enabled = false; 195 + include-blank-line-between-footnotes = false; 196 + }; 197 + re-index-footnotes.enabled = false; 198 + auto-correct-common-misspellings = { 199 + enabled = false; 200 + ignore-words = ""; 201 + skip-words-with-multiple-capitals = false; 202 + extra-auto-correct-files = [ ]; 203 + }; 204 + blockquote-style = { 205 + enabled = false; 206 + style = "space"; 207 + }; 208 + convert-bullet-list-markers.enabled = false; 209 + default-language-for-code-fences = { 210 + enabled = false; 211 + default-language = ""; 212 + }; 213 + emphasis-style = { 214 + enabled = false; 215 + style = "consistent"; 216 + }; 217 + no-bare-urls = { 218 + enabled = false; 219 + no-bare-uris = false; 220 + }; 221 + ordered-list-style = { 222 + enabled = false; 223 + number-style = "ascending"; 224 + list-end-style = "."; 225 + }; 226 + proper-ellipsis.enabled = false; 227 + quote-style = { 228 + enabled = false; 229 + single-quote-enabled = true; 230 + single-quote-style = "''"; 231 + double-quote-enabled = true; 232 + double-quote-style = "\"\""; 233 + }; 234 + remove-consecutive-list-markers.enabled = false; 235 + remove-empty-list-markers.enabled = false; 236 + remove-hyphenated-line-breaks.enabled = false; 237 + remove-multiple-spaces.enabled = false; 238 + strong-style = { 239 + enabled = false; 240 + style = "consistent"; 241 + }; 242 + two-spaces-between-lines-with-content = { 243 + enabled = false; 244 + line-break-indicator = " "; 245 + }; 246 + unordered-list-style = { 247 + enabled = false; 248 + list-style = "consistent"; 249 + }; 250 + compact-yaml = { 251 + enabled = false; 252 + inner-new-lines = false; 253 + }; 254 + consecutive-blank-lines.enabled = false; 255 + convert-spaces-to-tabs = { 256 + enabled = false; 257 + tabsize = 4; 258 + }; 259 + empty-line-around-blockquotes.enabled = false; 260 + empty-line-around-code-fences.enabled = false; 261 + empty-line-around-horizontal-rules.enabled = false; 262 + empty-line-around-math-blocks.enabled = false; 263 + empty-line-around-tables.enabled = false; 264 + heading-blank-lines = { 265 + enabled = false; 266 + bottom = true; 267 + empty-line-after-yaml = true; 268 + }; 269 + line-break-at-document-end.enabled = false; 270 + move-math-block-indicators-to-their-own-line.enabled = false; 271 + paragraph-blank-lines.enabled = false; 272 + remove-empty-lines-between-list-markers-and-checklists.enabled = false; 273 + remove-link-spacing.enabled = false; 274 + remove-space-around-characters = { 275 + enabled = false; 276 + include-fullwidth-forms = true; 277 + include-cjk-symbols-and-punctuation = true; 278 + include-dashes = true; 279 + other-symbols = ""; 280 + }; 281 + remove-space-before-or-after-characters = { 282 + enabled = false; 283 + characters-to-remove-space-before = ",!?;:).'\"]\"}"; 284 + characters-to-remove-space-after = "¿¡'\"([\""; 285 + }; 286 + space-after-list-markers.enabled = false; 287 + space-between-chinese-japanese-or-korean-and-english-or-numbers = { 288 + enabled = false; 289 + english-symbols-punctuation-before = "-+;:'\"°%$)]"; 290 + english-symbols-punctuation-after = "-+'\"([¥$"; 291 + }; 292 + trailing-spaces = { 293 + enabled = false; 294 + two-space-line-break = false; 295 + }; 296 + add-blockquote-indentation-on-paste.enabled = false; 297 + prevent-double-checklist-indicator-on-paste.enabled = false; 298 + prevent-double-list-item-indicator-on-paste.enabled = false; 299 + proper-ellipsis-on-paste.enabled = false; 300 + remove-hyphens-on-paste.enabled = false; 301 + remove-leading-or-trailing-whitespace-on-paste.enabled = false; 302 + remove-leftover-footnotes-from-quote-on-paste.enabled = false; 303 + remove-multiple-blank-lines-on-paste.enabled = false; 304 + }; 305 + lintOnSave = true; 306 + recordLintOnSaveLogs = false; 307 + displayChanged = true; 308 + suppressMessageWhenNoChange = false; 309 + lintOnFileChange = false; 310 + displayLintOnFileChangeNotice = false; 311 + settingsConvertedToConfigKeyValues = true; 312 + foldersToIgnore = [ ]; 313 + filesToIgnore = [ ]; 314 + linterLocale = "system-default"; 315 + logLevel = "ERROR"; 316 + lintCommands = [ ]; 317 + customRegexes = [ ]; 318 + commonStyles = { 319 + aliasArrayStyle = "single-line"; 320 + tagArrayStyle = "single-line"; 321 + minimumNumberOfDollarSignsToBeAMathBlock = 2; 322 + escapeCharacter = "\""; 323 + removeUnnecessaryEscapeCharsForMultiLineArrays = false; 324 + }; 325 + }; 326 + } 327 + { 328 + pkg = plugins.quickadd; 329 + settings = { 330 + choices = [ 331 + { 332 + id = "1d350c80-9184-4f8a-b37e-4e7c0712a19f"; 333 + name = "split"; 334 + type = "Macro"; 335 + command = true; 336 + runOnStartup = false; 337 + macro = { 338 + name = "split"; 339 + id = "707f5ace-fc9a-4999-b880-d3dea752ade3"; 340 + commands = [ 341 + { 342 + name = "split"; 343 + type = "UserScript"; 344 + id = "b9295f2c-177f-497c-aced-793bba9aca50"; 345 + path = "scripts/split.js"; 346 + settings = { }; 347 + } 348 + ]; 349 + }; 350 + } 351 + ]; 352 + inputPrompt = "single-line"; 353 + persistInputPromptDrafts = true; 354 + useSelectionAsCaptureValue = true; 355 + devMode = false; 356 + templateFolderPath = ""; 357 + announceUpdates = "major"; 358 + version = "2.11.0"; 359 + globalVariables = { }; 360 + onePageInputEnabled = false; 361 + disableOnlineFeatures = true; 362 + enableRibbonIcon = false; 363 + showCaptureNotification = true; 364 + showInputCancellationNotification = false; 365 + enableTemplatePropertyTypes = false; 366 + dateAliases = { 367 + t = "today"; 368 + tm = "tomorrow"; 369 + yd = "yesterday"; 370 + nw = "next week"; 371 + nm = "next month"; 372 + ny = "next year"; 373 + lw = "last week"; 374 + lm = "last month"; 375 + ly = "last year"; 376 + }; 377 + ai = { 378 + defaultModel = "Ask me"; 379 + # NOTE: The LaTeX in this prompt has extra backslashes vs the original 380 + # due to Nix string escaping (\t = tab in "..." strings). The original 381 + # prompt was already broken (missing backslashes on \eta, \cdot, etc.) 382 + # so this is a known cosmetic difference. 383 + defaultSystemPrompt = "As an AI assistant within Obsidian, your primary goal is to help users manage their ideas and knowledge more effectively. Format your responses using Markdown syntax. Please use the [[Obsidian]] link format. You can write aliases for the links by writing [[Obsidian|the alias after the pipe symbol]]. To use mathematical notation, use LaTeX syntax. LaTeX syntax for larger equations should be on separate lines, surrounded with double dollar signs ($$). You can also inline math expressions by wrapping it in $ symbols. For example, use $$w_{ij}^{\\text{new}}:=w_{ij}^{\\text{current}}+etacdotdelta_jcdot x_{ij}$$ on a separate line, but you can write \"($eta$ = learning rate, $delta_j$ = error term, $x_{ij}$ = input)\" inline."; 384 + promptTemplatesFolderPath = ""; 385 + showAssistant = true; 386 + providers = [ 387 + { 388 + name = "OpenAI"; 389 + endpoint = "https://api.openai.com/v1"; 390 + apiKey = ""; 391 + models = [ 392 + { 393 + name = "gpt-3.5-turbo"; 394 + maxTokens = 4096; 395 + } 396 + { 397 + name = "gpt-3.5-turbo-16k"; 398 + maxTokens = 16384; 399 + } 400 + { 401 + name = "gpt-3.5-turbo-1106"; 402 + maxTokens = 16385; 403 + } 404 + { 405 + name = "gpt-4"; 406 + maxTokens = 8192; 407 + } 408 + { 409 + name = "gpt-4-32k"; 410 + maxTokens = 32768; 411 + } 412 + { 413 + name = "gpt-4-1106-preview"; 414 + maxTokens = 128000; 415 + } 416 + { 417 + name = "gpt-4-turbo"; 418 + maxTokens = 128000; 419 + } 420 + { 421 + name = "gpt-4o"; 422 + maxTokens = 128000; 423 + } 424 + { 425 + name = "gpt-4o-mini"; 426 + maxTokens = 128000; 427 + } 428 + ]; 429 + autoSyncModels = false; 430 + modelSource = "modelsDev"; 431 + } 432 + { 433 + name = "Gemini"; 434 + endpoint = "https://generativelanguage.googleapis.com"; 435 + apiKey = ""; 436 + models = [ 437 + { 438 + name = "gemini-1.5-pro"; 439 + maxTokens = 1000000; 440 + } 441 + { 442 + name = "gemini-1.5-flash"; 443 + maxTokens = 1000000; 444 + } 445 + { 446 + name = "gemini-1.5-flash-8b"; 447 + maxTokens = 1000000; 448 + } 449 + ]; 450 + autoSyncModels = false; 451 + modelSource = "modelsDev"; 452 + } 453 + ]; 454 + }; 455 + migrations = { 456 + migrateToMacroIDFromEmbeddedMacro = true; 457 + useQuickAddTemplateFolder = true; 458 + incrementFileNameSettingMoveToDefaultBehavior = true; 459 + mutualExclusionInsertAfterAndWriteToBottomOfFile = true; 460 + setVersionAfterUpdateModalRelease = true; 461 + addDefaultAIProviders = true; 462 + removeMacroIndirection = true; 463 + migrateFileOpeningSettings = true; 464 + backfillFileOpeningDefaults = true; 465 + setProviderModelDiscoveryMode = true; 466 + migrateProviderApiKeysToSecretStorage = true; 467 + }; 468 + }; 469 + } 470 + { 471 + pkg = plugins.recent-files-obsidian; 472 + settings = { 473 + omittedPaths = [ ]; 474 + omittedTags = [ ]; 475 + updateOn = "file-open"; 476 + omitBookmarks = false; 477 + }; 478 + } 479 + { 480 + pkg = plugins.periodic-notes; 481 + settings = { 482 + showGettingStartedBanner = false; 483 + hasMigratedDailyNoteSettings = true; 484 + hasMigratedWeeklyNoteSettings = false; 485 + daily = { 486 + format = "YYYYMMDD"; 487 + folder = "My Day"; 488 + template = "zk-template"; 489 + enabled = true; 490 + }; 491 + weekly = { 492 + format = "YYMM-[W]ww"; 493 + template = "zk-template.md"; 494 + folder = "My Day"; 495 + enabled = true; 496 + }; 497 + monthly = { 498 + format = ""; 499 + template = ""; 500 + folder = ""; 501 + }; 502 + quarterly = { 503 + format = ""; 504 + template = ""; 505 + folder = ""; 506 + }; 507 + yearly = { 508 + format = ""; 509 + template = ""; 510 + folder = ""; 511 + }; 512 + }; 513 + } 514 + plugins.obsidian-vimrc-support 515 + plugins.obsidian-atmosphere 516 + ]; 517 + 518 + themes = [ 519 + { 520 + pkg = plugins.ayu-mirage; 521 + enable = false; # installed but not active (cssTheme = "") 522 + } 523 + ]; 524 + 525 + hotkeys = { 526 + "quickadd:choice:1d350c80-9184-4f8a-b37e-4e7c0712a19f" = [ 527 + { 528 + modifiers = [ "Ctrl" ]; 529 + key = "S"; 530 + } 531 + ]; 532 + "periodic-notes:open-daily-note" = [ 533 + { 534 + modifiers = [ "Ctrl" ]; 535 + key = "D"; 536 + } 537 + ]; 538 + "zk-prefixer" = [ 539 + { 540 + modifiers = [ "Ctrl" ]; 541 + key = "N"; 542 + } 543 + { 544 + modifiers = [ "Mod" ]; 545 + key = "N"; 546 + } 547 + ]; 548 + "file-explorer:new-file" = [ ]; 549 + }; 550 + }; 551 + 552 + vaults = { 553 + "kitaab/markdown" = { }; 554 + } 555 + // lib.optionalAttrs isDarwin { 556 + "usr/acreom/sourcegraph" = { }; 557 + }; 558 + }; 559 + 560 + # .obsidian.vimrc lives in the vault root, not inside .obsidian/ 561 + # Using home.file with source for symlink-based management 562 + home.file = { 563 + "kitaab/markdown/.obsidian.vimrc".source = ./.obsidian.vimrc; 564 + } 565 + // lib.optionalAttrs isDarwin { 566 + "usr/acreom/sourcegraph/.obsidian.vimrc".source = ./.obsidian.vimrc; 567 + }; 568 + }
+7 -3
pkgs/default.nix
··· 1 1 # Custom packages, that can be defined similarly to ones from nixpkgs 2 2 # You can build them using 'nix build .#example' or (legacy) 'nix-build -A example' 3 3 4 - { pkgs ? (import ../nixpkgs.nix) { } }: { 4 + { 5 + pkgs ? (import ../nixpkgs.nix) { }, 6 + }: 7 + { 5 8 plymouth-themes = pkgs.callPackage ./plymouth.nix { }; 6 9 tic-80 = pkgs.callPackage ./tic-80.nix { }; 7 10 fennel-ls = pkgs.callPackage ./fennel-ls.nix { }; ··· 11 14 # Wallabag is now an overlay 12 15 # TODO: we still use the patch from this folder though 13 16 my-wallabag = pkgs.callPackage ./wallabag.nix { }; 14 - # mautrix-slack = pkgs.callPackage ./mautrix-slack.nix { }; 15 - gpodder2go = pkgs.callPackage ./gpodder2go.nix { }; 17 + # mautrix-slack = pkgs.callPackage ./mautrix-slack.nix { }; 18 + gpodder2go = pkgs.callPackage ./gpodder2go.nix { }; 19 + obsidianPlugins = pkgs.callPackage ./obsidian-plugins { }; 16 20 }
+207
pkgs/obsidian-plugins/default.nix
··· 1 + { 2 + lib, 3 + stdenvNoCC, 4 + fetchurl, 5 + writeText, 6 + }: 7 + 8 + let 9 + # Helper to build an Obsidian plugin from pre-built GitHub release assets. 10 + # The home-manager module expects a package with manifest.json at the root. 11 + buildObsidianPlugin = 12 + { 13 + pname, 14 + version, 15 + owner, 16 + repo, 17 + mainJs, 18 + manifestJson, 19 + stylesCSS ? null, 20 + meta ? { }, 21 + }: 22 + stdenvNoCC.mkDerivation { 23 + inherit pname version; 24 + 25 + dontUnpack = true; 26 + 27 + installPhase = '' 28 + mkdir -p $out 29 + cp ${mainJs} $out/main.js 30 + cp ${manifestJson} $out/manifest.json 31 + '' 32 + + lib.optionalString (stylesCSS != null) '' 33 + cp ${stylesCSS} $out/styles.css 34 + ''; 35 + 36 + meta = { 37 + platforms = lib.platforms.all; 38 + } 39 + // meta; 40 + }; 41 + 42 + # Helper to build an Obsidian theme. 43 + # Themes need manifest.json and theme.css at the root. 44 + buildObsidianTheme = 45 + { 46 + pname, 47 + version, 48 + themeCSS, 49 + manifestJson, 50 + meta ? { }, 51 + }: 52 + stdenvNoCC.mkDerivation { 53 + inherit pname version; 54 + 55 + dontUnpack = true; 56 + 57 + installPhase = '' 58 + mkdir -p $out 59 + cp ${manifestJson} $out/manifest.json 60 + cp ${themeCSS} $out/theme.css 61 + ''; 62 + 63 + meta = { 64 + platforms = lib.platforms.all; 65 + } 66 + // meta; 67 + }; 68 + in 69 + { 70 + obsidian-linter = buildObsidianPlugin { 71 + pname = "obsidian-linter"; 72 + version = "1.31.0"; 73 + owner = "platers"; 74 + repo = "obsidian-linter"; 75 + mainJs = fetchurl { 76 + url = "https://github.com/platers/obsidian-linter/releases/download/1.31.0/main.js"; 77 + sha256 = "19k38qlm4g6jw4baqidyjs64aw3vlm01v9gz1f1dpn828csz8xiv"; 78 + }; 79 + manifestJson = fetchurl { 80 + url = "https://github.com/platers/obsidian-linter/releases/download/1.31.0/manifest.json"; 81 + sha256 = "0isjnpmsv6a0i1bj7rndwaafg5wp3ch7dxlvq49mbfw424dz76hm"; 82 + }; 83 + stylesCSS = fetchurl { 84 + url = "https://github.com/platers/obsidian-linter/releases/download/1.31.0/styles.css"; 85 + sha256 = "1nr27i0lvmxdzvgkzm8qwbcb4h4zmvyarc9kqk3msi590n5m1kqc"; 86 + }; 87 + meta.description = "Formats and styles your notes with configurable linting rules"; 88 + }; 89 + 90 + quickadd = buildObsidianPlugin { 91 + pname = "quickadd"; 92 + version = "2.11.0"; 93 + owner = "chhoumann"; 94 + repo = "quickadd"; 95 + mainJs = fetchurl { 96 + url = "https://github.com/chhoumann/quickadd/releases/download/2.11.0/main.js"; 97 + sha256 = "0my0zmk0yx1gls35rgn614m8zfbks962kd701fvb95xdvlqmdjc2"; 98 + }; 99 + manifestJson = fetchurl { 100 + url = "https://github.com/chhoumann/quickadd/releases/download/2.11.0/manifest.json"; 101 + sha256 = "02ky8jj6z8anxmsgmnxcsmigg936ddhphbpf2ags3l3sr48ic5fw"; 102 + }; 103 + stylesCSS = fetchurl { 104 + url = "https://github.com/chhoumann/quickadd/releases/download/2.11.0/styles.css"; 105 + sha256 = "1vrkwak5k7w8819viw0qdc2yl4p2kgs73xaykac0k2885wqxd0vp"; 106 + }; 107 + meta.description = "Quickly add new pages or content to your vault"; 108 + }; 109 + 110 + recent-files-obsidian = buildObsidianPlugin { 111 + pname = "recent-files-obsidian"; 112 + version = "1.7.6"; 113 + owner = "tgrosinger"; 114 + repo = "recent-files-obsidian"; 115 + mainJs = fetchurl { 116 + url = "https://github.com/tgrosinger/recent-files-obsidian/releases/download/1.7.6/main.js"; 117 + sha256 = "0awn6r451apl1z46wdbr4s4npngd8cga2qyzyp36gfa7ykvsaajl"; 118 + }; 119 + manifestJson = fetchurl { 120 + url = "https://github.com/tgrosinger/recent-files-obsidian/releases/download/1.7.6/manifest.json"; 121 + sha256 = "02q69wd16gygqr3z7bdzkk4qpi13d8w80jqr7ji7gam3mhs3s6ki"; 122 + }; 123 + stylesCSS = fetchurl { 124 + url = "https://github.com/tgrosinger/recent-files-obsidian/releases/download/1.7.6/styles.css"; 125 + sha256 = "1nrxrcr0h2vrwxg0dj64f99yifvnlrxnyqh938i4if0bmf99rr1f"; 126 + }; 127 + meta.description = "List files by most recently opened"; 128 + }; 129 + 130 + periodic-notes = buildObsidianPlugin { 131 + pname = "periodic-notes"; 132 + version = "0.0.17"; 133 + owner = "liamcain"; 134 + repo = "obsidian-periodic-notes"; 135 + mainJs = fetchurl { 136 + url = "https://github.com/liamcain/obsidian-periodic-notes/releases/download/0.0.17/main.js"; 137 + sha256 = "03lb3ydw5p6xh7gm642x8bzfvr93knpw653nzhv10gb9ff3a3wfc"; 138 + }; 139 + manifestJson = fetchurl { 140 + url = "https://github.com/liamcain/obsidian-periodic-notes/releases/download/0.0.17/manifest.json"; 141 + sha256 = "17042hj7zrm7x4sldl0l95blpzlpbf13b4s8vb5kyfsxywir78mx"; 142 + }; 143 + stylesCSS = fetchurl { 144 + url = "https://github.com/liamcain/obsidian-periodic-notes/releases/download/0.0.17/styles.css"; 145 + sha256 = "0f322kmq8h08amq22wgvi5lcwfkvzdpa9n155vnh0jf8sj2kjgv1"; 146 + }; 147 + meta.description = "Create/manage your daily, weekly, and monthly notes"; 148 + }; 149 + 150 + obsidian-vimrc-support = buildObsidianPlugin { 151 + pname = "obsidian-vimrc-support"; 152 + version = "0.10.2"; 153 + owner = "esm7"; 154 + repo = "obsidian-vimrc-support"; 155 + mainJs = fetchurl { 156 + url = "https://github.com/esm7/obsidian-vimrc-support/releases/download/0.10.2/main.js"; 157 + sha256 = "1qkc9rrh92hy5cbm0vqy4zbgccn53f1cll220mg51wpf35776qv8"; 158 + }; 159 + manifestJson = fetchurl { 160 + url = "https://github.com/esm7/obsidian-vimrc-support/releases/download/0.10.2/manifest.json"; 161 + sha256 = "0mnh4yz53zx7lsyqpl4zjy3sb48l5mb83qw9jayqxf4iwd5mmpmj"; 162 + }; 163 + meta.description = "Auto-load a startup file with Obsidian Vim commands"; 164 + }; 165 + 166 + obsidian-atmosphere = buildObsidianPlugin { 167 + pname = "obsidian-atmosphere"; 168 + version = "0.1.19"; 169 + owner = "treethought"; 170 + repo = "obsidian-atmosphere"; 171 + mainJs = fetchurl { 172 + url = "https://github.com/treethought/obsidian-atmosphere/releases/download/0.1.19/main.js"; 173 + sha256 = "0ab2lzclbjzyprlar68qyx8cpbyfmxzpc4slrp0yp9f6yhz4pn91"; 174 + }; 175 + manifestJson = fetchurl { 176 + url = "https://github.com/treethought/obsidian-atmosphere/releases/download/0.1.19/manifest.json"; 177 + sha256 = "0qrfdz6xwl8jgbdkqsaxgk5jma1xna5xa1m3jcnlwmbsk6gnf7i8"; 178 + }; 179 + stylesCSS = fetchurl { 180 + url = "https://github.com/treethought/obsidian-atmosphere/releases/download/0.1.19/styles.css"; 181 + sha256 = "09022ykg2wipjkq8ysjkq4js5prhm8ll0kcsz1359xs45s06ajym"; 182 + }; 183 + meta.description = "Ambient weather and nature effects for Obsidian"; 184 + }; 185 + 186 + # Ayu Mirage theme 187 + # The upstream repo (bcdavasconcelos/Obsidian-Ayu_Mirage) uses the legacy 188 + # format (obsidian.css). We fetch it and provide the manifest.json that 189 + # Obsidian generated when installing it. 190 + ayu-mirage = buildObsidianTheme { 191 + pname = "ayu-mirage"; 192 + version = "0.0.0"; 193 + themeCSS = fetchurl { 194 + url = "https://raw.githubusercontent.com/bcdavasconcelos/Obsidian-Ayu_Mirage/master/obsidian.css"; 195 + sha256 = "0hcsgc8vlj0r2nwl1l4cvi9rr72m2aifyd3g538l0qrk5l6b1dqv"; 196 + }; 197 + manifestJson = writeText "manifest.json" ( 198 + builtins.toJSON { 199 + name = "Ayu Mirage"; 200 + version = "0.0.0"; 201 + minAppVersion = "0.16.0"; 202 + author = "bernardo_v"; 203 + } 204 + ); 205 + meta.description = "Ayu Mirage dark theme for Obsidian"; 206 + }; 207 + }