Skip to content

About

Nix expressions for Obsidian plugins and themes

Resources

Stars

14 stars

Watchers

1 watching

Forks

Latest commit

 

History

123 Commits

Folders and files

Repository files navigation

nix-obsidian-extensions

Nix packages for Obsidian community plugins and themes, scraped daily from the obsidianmd/obsidian-releases registry.

Consumed by the home-manager programs.obsidian module.

Usage

Add the flake alongside home-manager:

inputs = {
  nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";

  home-manager = {
    url = "github:nix-community/home-manager";
    inputs.nixpkgs.follows = "nixpkgs";
  };

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

Apply the overlay wherever home-manager takes its pkgs from: nixpkgs.overlays in the home configuration, or in the system configuration if home-manager.useGlobalPkgs is true.

{ pkgs, ... }:
{
  programs.obsidian = {
    enable = true;

    vaults."Documents/notes".enable = true;

    defaultSettings = {
      communityPlugins = with pkgs.obsidianPlugins; [
        dataview
        table-editor-obsidian
      ];

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

See the home-manager options for the rest of programs.obsidian.

Attributes

overlays.default adds two sets to pkgs:

  • pkgs.obsidianPlugins.<id>, keyed by registry plugin id, e.g. pkgs.obsidianPlugins.dataview
  • pkgs.obsidianThemes.<name>, keyed by a sanitized theme name, e.g. pkgs.obsidianThemes.things

Both are also exposed as legacyPackages.<system>.obsidianPlugins and legacyPackages.<system>.obsidianThemes for nix eval and nix build.

Every package is a directory of prebuilt assets. Plugins hold main.js, manifest.json, and styles.css where the release ships one, taken from the GitHub release matching the manifest version. Themes hold theme.css (or obsidian.css on older ones) and manifest.json where present, taken from a pinned commit on the repo's default branch.

Naming

Plugins keep their registry id.

Themes have no id, only a display name, so the attribute name is derived from it: lowercased, with every run of non-alphanumeric characters collapsed to a single - and any leading or trailing - stripped. On a collision both get the owner prefixed as <owner>-<name>.

Updating

data/plugins.json and data/themes.json are regenerated by packages/update:

nix run .#update

Licensing

The flake code is MIT licensed (see LICENSE). Plugins and themes are fetched from their upstream repositories at build time and remain under their own licenses; this repository stores only pinned URLs and hashes. The obsidian-releases registry is unlicensed metadata.

About

Nix expressions for Obsidian plugins and themes

Resources

Stars

14 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages