Jump to content

Obsidian: Difference between revisions

From Official NixOS Wiki
DoggoBit (talk | contribs)
add infobox
Nyxar77 (talk | contribs)
No edit summary
 
(2 intermediate revisions by 2 users not shown)
Line 2: Line 2:
| name = Obsidian
| name = Obsidian
| type = Native
| type = Native
| image = 2023 Obsidian logo.svg
| image = https://obsidian.md/favicon.svg
| website = [https://obsidian.md obsidian.md]
| website = [https://obsidian.md obsidian.md]
| documentation = [https://help.obsidian.md/ Obsidian Help]
| github = obsidianmd
| documentation = [https://help.obsidian.md Obsidian Help]
| initialRelease = 10 March 2020
| initialRelease = 10 March 2020
| latestRelease = 1.8.10; 22 April 2025
| os = Linux, macOS, Windows, iOS, Android
| os = Linux, macOS, Windows, iOS, Android
}}{{Tip/unfree}}
}}


'''Obsidian''' is a proprietary closed-source note-taking app and text editor, that supports [[Markdown]] and [[LaTeX]]. It is the more popular equivalent to the open-source [[Logseq]].
{{Tip/unfree}}
 
[https://obsidian.md '''Obsidian'''] is a proprietary note-taking application and Markdown editor. Notes are stored as regular files inside directories called ''vaults''.


== Installation ==
== Installation ==
Obsidian can be installed from nixpkgs:<syntaxhighlight lang="nixos">
 
environment.systemPackages = with pkgs; [
=== NixOS ===
  obsidian
 
];
<syntaxhighlight lang="nix">
{
  nixpkgs.config.allowUnfree = true;
 
  environment.systemPackages = with pkgs; [
    obsidian
  ];
}
</syntaxhighlight>
 
=== Home Manager ===
 
[[Home Manager]] can install Obsidian and manage settings for individual vaults.
 
<syntaxhighlight lang="nix">
{
  programs.obsidian = {
    enable = true;
 
    vaults.notes.target = "Documents/Obsidian";
 
    defaultSettings.app = {
      alwaysUpdateLinks = true;
      spellcheck = true;
    };
  };
}
</syntaxhighlight>
 
The vault path is relative to the user's home directory. The example above manages <code>~/Documents/Obsidian</code>.
 
The <code>notes</code> attribute is only an internal Home Manager name.
 
{{Note|Without a declared vault, Home Manager installs Obsidian but does not manage vault-specific settings, plugins or themes.}}
 
== Core plugins ==
 
Core plugins are included with Obsidian and can be enabled declaratively:
 
<syntaxhighlight lang="nix">
{
  programs.obsidian.defaultSettings.corePlugins = [
    "backlink"
    "bookmarks"
    "daily-notes"
    "file-explorer"
    "global-search"
    "templates"
  ];
}
</syntaxhighlight>
 
{{Warning|This list is exhaustive. Core plugins omitted from it are disabled. Leave the option unset to manage core plugins through Obsidian.}}
 
Plugin-specific settings can also be declared:
 
<syntaxhighlight lang="nix">
{
  programs.obsidian.defaultSettings.corePlugins = [
    {
      name = "daily-notes";
      settings = {
        folder = "Daily";
        format = "YYYY-MM-DD";
      };
    }
    {
      name = "templates";
      settings.folder = "Templates";
    }
  ];
}
</syntaxhighlight>
 
== Community plugins and themes ==
 
Home Manager supports packaged plugins and themes, but does not provide a package collection for them.
 
The third-party [https://github.com/karaolidis/nix-obsidian-extensions nix-obsidian-extensions] flake provides packages from the official Obsidian registries.
 
{{Warning|This flake is not part of Nixpkgs, Home Manager, nix-community or the NixOS project.}}
 
=== Flake input ===
 
Add the input to <code>flake.nix</code>:
 
<syntaxhighlight lang="nix">
{
  inputs = {
    # ...
 
    obsidian-extensions = {
      url = "github:karaolidis/nix-obsidian-extensions";
      inputs.nixpkgs.follows = "nixpkgs";
    };
  };
 
  # ...
}
</syntaxhighlight>
 
=== Overlay ===
 
Apply the overlay to the package set used by Home Manager:
 
<syntaxhighlight lang="nix">
{
  nixpkgs.overlays = [
    inputs.obsidian-extensions.overlays.default
  ];
}
</syntaxhighlight>
 
This adds:
 
* <code>pkgs.obsidianPlugins</code>
* <code>pkgs.obsidianThemes</code>
 
When Home Manager is used as a NixOS module with <code>home-manager.useGlobalPkgs = true</code>, apply the overlay in the NixOS configuration.
 
Standalone Home Manager supports the same <code>nixpkgs.overlays</code> option.
 
=== Installing plugins and themes ===
 
<syntaxhighlight lang="nix">
{ pkgs, ... }:
 
{
  programs.obsidian = {
    enable = true;
 
    vaults.notes.target = "Documents/Obsidian";
 
    defaultSettings = {
      communityPlugins = with pkgs.obsidianPlugins; [
        dataview
        obsidian-git
        obsidian-importer
        vim-yank-highlight
      ];
 
      themes = with pkgs.obsidianThemes; [
        catppuccin
      ];
    };
  };
}
</syntaxhighlight>
</syntaxhighlight>
Plugin attributes use the IDs from the official Obsidian plugin registry. They do not always match the display names shown in Obsidian.
Available extensions can be listed with:
<syntaxhighlight lang="console">
# Plugins
$ nix eval \
    --json \
    github:karaolidis/nix-obsidian-extensions#legacyPackages.x86_64-linux.obsidianPlugins \
    --apply builtins.attrNames
# Themes
$ nix eval \
    --json \
    github:karaolidis/nix-obsidian-extensions#legacyPackages.x86_64-linux.obsidianThemes \
    --apply builtins.attrNames
</syntaxhighlight>
Plugin settings can be written to their <code>data.json</code> files:
<syntaxhighlight lang="nix">
{
  programs.obsidian.defaultSettings.communityPlugins = [
    {
      pkg = pkgs.obsidianPlugins.example-plugin;
      settings = {
        exampleOption = true;
      };
    }
  ];
}
</syntaxhighlight>
== Declarative and manual management ==
Declaratively managed plugins and themes are linked from the immutable Nix store.
Therefore:
* they generally cannot be updated from Obsidian;
* manual changes may be replaced on the next activation;
* removing them from the Nix configuration removes them from the managed vault.
To manage plugins and themes manually, leave their options unset:
<syntaxhighlight lang="nix">
{
  programs.obsidian = {
    enable = true;
    vaults.notes.target = "Documents/Obsidian";
    defaultSettings = {
      communityPlugins = null;
      themes = null;
    };
  };
}
</syntaxhighlight>
Both options are <code>null</code> by default.
== Applying the configuration ==
<syntaxhighlight lang="console">
# NixOS
$ sudo nixos-rebuild switch --flake .
# Standalone Home Manager
$ home-manager switch --flake .
</syntaxhighlight>
== See also ==
* [https://help.obsidian.md Obsidian documentation]
* [https://nix-community.github.io/home-manager/options.xhtml#opt-programs.obsidian.enable Home Manager options]
* [https://github.com/karaolidis/nix-obsidian-extensions nix-obsidian-extensions]
* [[Home Manager]]
* [[Logseq]]


[[Category:Applications]]
[[Category:Applications]]
[[Category:Note taking]]
[[Category:Note taking]]

Latest revision as of 16:54, 1 August 2026

Obsidian

Native Application

Initial release10 March 2020
Operating SystemLinux, macOS, Windows, iOS, Android
External links
Websiteobsidian.md
GitHubobsidianmd
DocumentationObsidian Help
🟆︎
Tip: This package is unfree, and will require extra steps to install. You can read more about allowing unfree software in the Nixpkgs Manual.

Obsidian is a proprietary note-taking application and Markdown editor. Notes are stored as regular files inside directories called vaults.

Installation

NixOS

{
  nixpkgs.config.allowUnfree = true;

  environment.systemPackages = with pkgs; [
    obsidian
  ];
}

Home Manager

Home Manager can install Obsidian and manage settings for individual vaults.

{
  programs.obsidian = {
    enable = true;

    vaults.notes.target = "Documents/Obsidian";

    defaultSettings.app = {
      alwaysUpdateLinks = true;
      spellcheck = true;
    };
  };
}

The vault path is relative to the user's home directory. The example above manages ~/Documents/Obsidian.

The notes attribute is only an internal Home Manager name.

Note: Without a declared vault, Home Manager installs Obsidian but does not manage vault-specific settings, plugins or themes.

Core plugins

Core plugins are included with Obsidian and can be enabled declaratively:

{
  programs.obsidian.defaultSettings.corePlugins = [
    "backlink"
    "bookmarks"
    "daily-notes"
    "file-explorer"
    "global-search"
    "templates"
  ];
}
⚠︎
Warning: This list is exhaustive. Core plugins omitted from it are disabled. Leave the option unset to manage core plugins through Obsidian.

Plugin-specific settings can also be declared:

{
  programs.obsidian.defaultSettings.corePlugins = [
    {
      name = "daily-notes";
      settings = {
        folder = "Daily";
        format = "YYYY-MM-DD";
      };
    }
    {
      name = "templates";
      settings.folder = "Templates";
    }
  ];
}

Community plugins and themes

Home Manager supports packaged plugins and themes, but does not provide a package collection for them.

The third-party nix-obsidian-extensions flake provides packages from the official Obsidian registries.

⚠︎
Warning: This flake is not part of Nixpkgs, Home Manager, nix-community or the NixOS project.

Flake input

Add the input to flake.nix:

{
  inputs = {
    # ...

    obsidian-extensions = {
      url = "github:karaolidis/nix-obsidian-extensions";
      inputs.nixpkgs.follows = "nixpkgs";
    };
  };

  # ...
}

Overlay

Apply the overlay to the package set used by Home Manager:

{
  nixpkgs.overlays = [
    inputs.obsidian-extensions.overlays.default
  ];
}

This adds:

  • pkgs.obsidianPlugins
  • pkgs.obsidianThemes

When Home Manager is used as a NixOS module with home-manager.useGlobalPkgs = true, apply the overlay in the NixOS configuration.

Standalone Home Manager supports the same nixpkgs.overlays option.

Installing plugins and themes

{ pkgs, ... }:

{
  programs.obsidian = {
    enable = true;

    vaults.notes.target = "Documents/Obsidian";

    defaultSettings = {
      communityPlugins = with pkgs.obsidianPlugins; [
        dataview
        obsidian-git
        obsidian-importer
        vim-yank-highlight
      ];

      themes = with pkgs.obsidianThemes; [
        catppuccin
      ];
    };
  };
}

Plugin attributes use the IDs from the official Obsidian plugin registry. They do not always match the display names shown in Obsidian.

Available extensions can be listed with:

# Plugins
$ nix eval \
    --json \
    github:karaolidis/nix-obsidian-extensions#legacyPackages.x86_64-linux.obsidianPlugins \
    --apply builtins.attrNames

# Themes
$ nix eval \
    --json \
    github:karaolidis/nix-obsidian-extensions#legacyPackages.x86_64-linux.obsidianThemes \
    --apply builtins.attrNames

Plugin settings can be written to their data.json files:

{
  programs.obsidian.defaultSettings.communityPlugins = [
    {
      pkg = pkgs.obsidianPlugins.example-plugin;
      settings = {
        exampleOption = true;
      };
    }
  ];
}

Declarative and manual management

Declaratively managed plugins and themes are linked from the immutable Nix store.

Therefore:

  • they generally cannot be updated from Obsidian;
  • manual changes may be replaced on the next activation;
  • removing them from the Nix configuration removes them from the managed vault.

To manage plugins and themes manually, leave their options unset:

{
  programs.obsidian = {
    enable = true;

    vaults.notes.target = "Documents/Obsidian";

    defaultSettings = {
      communityPlugins = null;
      themes = null;
    };
  };
}

Both options are null by default.

Applying the configuration

# NixOS
$ sudo nixos-rebuild switch --flake .

# Standalone Home Manager
$ home-manager switch --flake .

See also