Add more personal obsidian configs
Signed-off-by: Nikolaos Karaolidis <nick@karaolidis.com>
This commit is contained in:
36
flake.lock
generated
36
flake.lock
generated
@@ -4,14 +4,15 @@
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
"nixpkgs"
|
||||
]
|
||||
],
|
||||
"systems": "systems"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1718921313,
|
||||
"narHash": "sha256-TFJah1RW5qnYW7kajjAFPAS5j/0q0R3vz9zPjrRA0Mc=",
|
||||
"lastModified": 1721306136,
|
||||
"narHash": "sha256-VKPsIGf3/a+RONBipx4lEE4LXG2sdMNkWQu22LNQItg=",
|
||||
"owner": "Aylur",
|
||||
"repo": "ags",
|
||||
"rev": "646d5ad073ff7f8b1d50cfbd40f5b8a250fcd59d",
|
||||
"rev": "344ea72cd3b8d4911f362fec34bce7d8fb37028c",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -27,11 +28,11 @@
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1720661479,
|
||||
"narHash": "sha256-nsGgA14vVn0GGiqEfomtVgviRJCuSR3UEopfP8ixW1I=",
|
||||
"lastModified": 1721417620,
|
||||
"narHash": "sha256-6q9b1h8fI3hXg2DG6/vrKWCeG8c5Wj2Kvv22RCgedzg=",
|
||||
"owner": "nix-community",
|
||||
"repo": "disko",
|
||||
"rev": "786965e1b1ed3fd2018d78399984f461e2a44689",
|
||||
"rev": "bec6e3cde912b8acb915fecdc509eda7c973fb42",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -79,11 +80,11 @@
|
||||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1720966710,
|
||||
"narHash": "sha256-cHBkUqyRAW+hxKTnAmDp83prQzRiF8fdIdz5QwpwL6w=",
|
||||
"lastModified": 1721430942,
|
||||
"narHash": "sha256-umtjLBZTpyPxi92BaHGnzlAg1RVZE8odRhjMxY7hVCc=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "37566db10b2b3da434d9ce2a01088efd76f72200",
|
||||
"rev": "f29426dca8ccacd68ea6afb1bbc317158b5e1df2",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -139,6 +140,21 @@
|
||||
"repo": "sops-nix",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"systems": {
|
||||
"locked": {
|
||||
"lastModified": 1689347949,
|
||||
"narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=",
|
||||
"owner": "nix-systems",
|
||||
"repo": "default-linux",
|
||||
"rev": "31732fcf5e8fea42e59c2488ad31a0e651500f68",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nix-systems",
|
||||
"repo": "default-linux",
|
||||
"type": "github"
|
||||
}
|
||||
}
|
||||
},
|
||||
"root": "root",
|
||||
|
21
flake.nix
21
flake.nix
@@ -1,32 +1,47 @@
|
||||
{
|
||||
inputs = {
|
||||
nixpkgs = {
|
||||
# --- Official
|
||||
type = "github";
|
||||
owner = "NixOS";
|
||||
# owner = "karaolidis";
|
||||
repo = "nixpkgs";
|
||||
ref = "master";
|
||||
# --- Fork
|
||||
# type = "github";
|
||||
# owner = "karaolidis";
|
||||
# repo = "nixpkgs";
|
||||
# ref = "integration";
|
||||
# --- Local
|
||||
# url = "git+file:./submodules/nixpkgs";
|
||||
};
|
||||
|
||||
home-manager = {
|
||||
type = "github";
|
||||
# --- Official
|
||||
# type = "github";
|
||||
# owner = "nix-community"
|
||||
# repo = "home-manager";
|
||||
# --- Fork
|
||||
type = "github";
|
||||
owner = "karaolidis";
|
||||
repo = "home-manager";
|
||||
ref = "integration";
|
||||
# --- Local
|
||||
# url = "git+file:./submodules/home-manager";
|
||||
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
impermanence = {
|
||||
type = "github";
|
||||
# --- Official
|
||||
# type = "github";
|
||||
# owner = "nix-community"
|
||||
# repo = "impermanence";
|
||||
# --- Fork
|
||||
type = "github";
|
||||
owner = "karaolidis";
|
||||
repo = "impermanence";
|
||||
ref = "integration";
|
||||
# --- Local
|
||||
# url = "git+file:./submodules/impermanence";
|
||||
};
|
||||
|
||||
|
@@ -69,8 +69,8 @@ in
|
||||
};
|
||||
|
||||
sops.secrets = {
|
||||
"gpg-agent/pgp.key" = { };
|
||||
"gpg-agent/pgp.pass" = { };
|
||||
"gpg-agent/pgp/key" = { };
|
||||
"gpg-agent/pgp/pass" = { };
|
||||
};
|
||||
};
|
||||
}
|
||||
|
@@ -1,5 +1,10 @@
|
||||
for keyfile in "$HOME"/.config/sops-nix/secrets/gpg-agent/*.key; do
|
||||
passfile="${keyfile%.key}.pass"
|
||||
for dir in "$HOME"/.config/sops-nix/secrets/gpg-agent/*; do
|
||||
keyfile="$dir/key"
|
||||
passfile="$dir/pass"
|
||||
|
||||
if [ ! -f "$keyfile" ]; then
|
||||
continue
|
||||
fi
|
||||
|
||||
if [ -f "$passfile" ]; then
|
||||
gpg2 --batch --yes --pinentry-mode loopback --passphrase-file "$passfile" --import "$keyfile"
|
||||
|
@@ -18,7 +18,11 @@ in
|
||||
xdg = {
|
||||
enable = true;
|
||||
mimeApps.enable = true;
|
||||
portal.extraPortals = with pkgs; [ xdg-desktop-portal-gtk ];
|
||||
|
||||
portal = {
|
||||
xdgOpenUsePortal = true;
|
||||
extraPortals = with pkgs; [ xdg-desktop-portal-gtk ];
|
||||
};
|
||||
|
||||
userDirs = {
|
||||
enable = true;
|
||||
@@ -29,16 +33,19 @@ in
|
||||
};
|
||||
};
|
||||
|
||||
home.persistence."/persist${userConfig.home}".directories = with hmConfig.xdg.userDirs; [
|
||||
relativeDesktop
|
||||
relativeDocuments
|
||||
relativeDownload
|
||||
relativeMusic
|
||||
relativePictures
|
||||
relativeTemplates
|
||||
relativeVideos
|
||||
"VMs"
|
||||
"git"
|
||||
];
|
||||
home = {
|
||||
packages = with pkgs; [ xdg-utils ];
|
||||
persistence."/persist${userConfig.home}".directories = with hmConfig.xdg.userDirs; [
|
||||
relativeDesktop
|
||||
relativeDocuments
|
||||
relativeDownload
|
||||
relativeMusic
|
||||
relativePictures
|
||||
relativeTemplates
|
||||
relativeVideos
|
||||
"VMs"
|
||||
"git"
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
|
@@ -1,4 +1,3 @@
|
||||
!*/.obsidian/bookmarks.json
|
||||
|
||||
*/.obsidian
|
||||
.nomedia
|
||||
|
@@ -38,8 +38,27 @@ in
|
||||
|
||||
corePlugins = [
|
||||
"bookmarks"
|
||||
{
|
||||
name = "canvas";
|
||||
options = {
|
||||
newFileLocation = "folder";
|
||||
newFileFolderPath = "Inbox";
|
||||
defaultWheelBehavior = "zoom";
|
||||
};
|
||||
}
|
||||
"canvas"
|
||||
"command-palette"
|
||||
{
|
||||
name = "command-palette";
|
||||
options = {
|
||||
pinned = [
|
||||
"file-explorer:new-file"
|
||||
"canvas:new-file"
|
||||
"obsidian-excalidraw-plugin:excalidraw-autocreate-on-current"
|
||||
"obsidian-kanban:create-new-kanban-board"
|
||||
"obsidian-read-it-later:save-clipboard-to-notice"
|
||||
];
|
||||
};
|
||||
}
|
||||
"editor-status"
|
||||
"file-explorer"
|
||||
"global-search"
|
||||
@@ -53,10 +72,34 @@ in
|
||||
"tag-pane"
|
||||
];
|
||||
|
||||
plugins = [
|
||||
communityPlugins = [
|
||||
{
|
||||
pkg = import ./plugins/better-word-count { inherit pkgs; };
|
||||
options = {
|
||||
statusBar = [
|
||||
{
|
||||
suffix = " words";
|
||||
metric = {
|
||||
type = 0;
|
||||
counter = 0;
|
||||
};
|
||||
}
|
||||
];
|
||||
altBar = [
|
||||
{
|
||||
suffix = " files";
|
||||
metric = {
|
||||
type = 2;
|
||||
counter = 6;
|
||||
};
|
||||
}
|
||||
];
|
||||
countComments = true; # Inverse
|
||||
};
|
||||
}
|
||||
{
|
||||
pkg = import ./plugins/custom-sort { inherit pkgs; };
|
||||
extraFiles."data.json".source = (pkgs.formats.json { }).generate "data.json" {
|
||||
options = {
|
||||
suspended = false;
|
||||
statusBarEntryEnabled = false;
|
||||
notificationsEnabled = false;
|
||||
@@ -68,7 +111,7 @@ in
|
||||
}
|
||||
{
|
||||
pkg = import ./plugins/dataview { inherit pkgs; };
|
||||
extraFiles."data.json".source = (pkgs.formats.json { }).generate "data.json" {
|
||||
options = {
|
||||
enableDataviewJs = true;
|
||||
enableInlineDataviewJs = true;
|
||||
warnOnEmptyResult = false;
|
||||
@@ -78,7 +121,7 @@ in
|
||||
}
|
||||
{
|
||||
pkg = import ./plugins/excalidraw { inherit pkgs; };
|
||||
extraFiles."data.json".source = (pkgs.formats.json { }).generate "data.json" {
|
||||
options = {
|
||||
folder = "Inbox";
|
||||
templateFilePath = "Templates";
|
||||
scriptFolderPath = "Scripts";
|
||||
@@ -99,9 +142,16 @@ in
|
||||
showNewVersionNotification = false;
|
||||
};
|
||||
}
|
||||
{
|
||||
pkg = import ./plugins/folder-note { inherit pkgs; };
|
||||
options = {
|
||||
folderNoteHide = false;
|
||||
folderNoteStrInit = "";
|
||||
};
|
||||
}
|
||||
{
|
||||
pkg = import ./plugins/kanban { inherit pkgs; };
|
||||
extraFiles."data.json".source = (pkgs.formats.json { }).generate "data.json" {
|
||||
options = {
|
||||
move-tags = true;
|
||||
move-dates = true;
|
||||
date-display-format = "DD/MM/YYYY";
|
||||
@@ -113,9 +163,18 @@ in
|
||||
show-board-settings = false;
|
||||
};
|
||||
}
|
||||
{
|
||||
pkg = import ./plugins/languagetool { inherit pkgs; };
|
||||
options = {
|
||||
shouldAutoCheck = true;
|
||||
pickyMode = true;
|
||||
staticLanguage = "auto";
|
||||
englishVariety = "en-US";
|
||||
};
|
||||
}
|
||||
{
|
||||
pkg = import ./plugins/linter { inherit pkgs; };
|
||||
extraFiles."data.json".source = (pkgs.formats.json { }).generate "data.json" {
|
||||
options = {
|
||||
lintOnSave = true;
|
||||
displayChanged = false;
|
||||
lintOnFileChange = true;
|
||||
@@ -258,23 +317,175 @@ in
|
||||
};
|
||||
};
|
||||
}
|
||||
{
|
||||
pkg = import ./plugins/map-view { inherit pkgs; };
|
||||
options = {
|
||||
"markerIconRules" = [
|
||||
{
|
||||
"ruleName" = "default";
|
||||
"preset" = true;
|
||||
"iconDetails" = {
|
||||
"prefix" = "fas";
|
||||
"icon" = "fa-circle";
|
||||
"markerColor" = "blue";
|
||||
};
|
||||
}
|
||||
{
|
||||
"ruleName" = "#restaurant";
|
||||
"preset" = false;
|
||||
"iconDetails" = {
|
||||
"prefix" = "fas";
|
||||
"icon" = "fa-utensils";
|
||||
"markerColor" = "red";
|
||||
};
|
||||
}
|
||||
{
|
||||
"ruleName" = "#bar";
|
||||
"preset" = false;
|
||||
"iconDetails" = {
|
||||
"prefix" = "fas";
|
||||
"icon" = "fa-martini-glass";
|
||||
"markerColor" = "purple";
|
||||
};
|
||||
}
|
||||
{
|
||||
"ruleName" = "#coffee";
|
||||
"preset" = false;
|
||||
"iconDetails" = {
|
||||
"prefix" = "fas";
|
||||
"icon" = "fa-mug-hot";
|
||||
"markerColor" = "purple";
|
||||
};
|
||||
}
|
||||
{
|
||||
"ruleName" = "#culture";
|
||||
"preset" = false;
|
||||
"iconDetails" = {
|
||||
"prefix" = "fas";
|
||||
"icon" = "fa-building-columns";
|
||||
"markerColor" = "black";
|
||||
};
|
||||
}
|
||||
{
|
||||
"ruleName" = "#shopping";
|
||||
"preset" = false;
|
||||
"iconDetails" = {
|
||||
"prefix" = "fas";
|
||||
"icon" = "fa-shopping-bag";
|
||||
"markerColor" = "yellow";
|
||||
};
|
||||
}
|
||||
{
|
||||
"ruleName" = "#entertainment";
|
||||
"preset" = false;
|
||||
"iconDetails" = {
|
||||
"prefix" = "fas";
|
||||
"icon" = "fa-microphone";
|
||||
"markerColor" = "pink";
|
||||
};
|
||||
}
|
||||
{
|
||||
"ruleName" = "#nature";
|
||||
"preset" = false;
|
||||
"iconDetails" = {
|
||||
"prefix" = "fas";
|
||||
"icon" = "fa-tree";
|
||||
"markerColor" = "green";
|
||||
};
|
||||
}
|
||||
];
|
||||
"searchProvider" = "google";
|
||||
"geocodingApiMethod" = "path";
|
||||
"geocodingApiPath" = hmConfig.sops.secrets."google/geocoding".path;
|
||||
"useGooglePlaces" = true;
|
||||
"letZoomBeyondMax" = true;
|
||||
"showGeolinkPreview" = true;
|
||||
"newNotePath" = "Inbox";
|
||||
};
|
||||
}
|
||||
{
|
||||
pkg = import ./plugins/minimal-settings { inherit pkgs; };
|
||||
extraFiles."data.json".source = (pkgs.formats.json { }).generate "data.json" {
|
||||
options = {
|
||||
editorFont = "var(--font-monospace)";
|
||||
};
|
||||
}
|
||||
{
|
||||
pkg = import ./plugins/outliner { inherit pkgs; };
|
||||
extraFiles."data.json".source = (pkgs.formats.json { }).generate "data.json" {
|
||||
options = {
|
||||
styleLists = false;
|
||||
stickCursor = "never";
|
||||
};
|
||||
}
|
||||
{
|
||||
pkg = import ./plugins/read-it-later { inherit pkgs; };
|
||||
options = {
|
||||
inboxDir = "Inbox";
|
||||
assetsDir = "Inbox/assets";
|
||||
openNewNote = true;
|
||||
youtubeNote = ''
|
||||
## [%videoTitle%](%videoURL%)
|
||||
|
||||
%videoPlayer%
|
||||
'';
|
||||
vimeoNote = ''
|
||||
## [%videoTitle%](%videoURL%)
|
||||
|
||||
%videoPlayer%
|
||||
'';
|
||||
bilibiliNote = ''
|
||||
## [%videoTitle%](%videoURL%)
|
||||
|
||||
%videoPlayer%
|
||||
'';
|
||||
twitterNote = ''
|
||||
## [%tweetAuthorName%](%tweetURL%)
|
||||
|
||||
%tweetContent%
|
||||
'';
|
||||
parsableArticleNote = ''
|
||||
## [%articleTitle%](%articleURL%)
|
||||
|
||||
%articleContent%
|
||||
'';
|
||||
mastodonNote = ''
|
||||
## [%tootAuthorName%](%tootURL%)
|
||||
|
||||
> %tootContent%
|
||||
'';
|
||||
stackExchangeNote = ''
|
||||
## [%questionTitle%](%questionURL%)
|
||||
|
||||
Author: [%authorName%](%authorProfileURL%)
|
||||
|
||||
%questionContent%
|
||||
|
||||
***
|
||||
|
||||
%topAnswer%
|
||||
|
||||
%answers%
|
||||
'';
|
||||
stackExchangeAnswer = ''
|
||||
Answered by: [%authorName%](%authorProfileURL%)
|
||||
|
||||
> %answerContent%
|
||||
'';
|
||||
tikTokNote = ''
|
||||
## [%videoDescription%](%videoURL%)
|
||||
|
||||
%videoPlayer%
|
||||
'';
|
||||
notParsableArticleNote = "[%previewURL%](%articleURL%)";
|
||||
textSnippetNote = "%content%";
|
||||
downloadImagesInArticleDir = true;
|
||||
downloadMastodonMediaAttachmentsInDir = true;
|
||||
downloadStackExchangeAssetsInDir = true;
|
||||
};
|
||||
}
|
||||
(import ./plugins/style-settings { inherit pkgs; })
|
||||
{
|
||||
pkg = import ./plugins/tasks { inherit pkgs; };
|
||||
extraFiles."data.json".source = (pkgs.formats.json { }).generate "data.json" {
|
||||
options = {
|
||||
globalQuery = "short mode";
|
||||
globalFilter = "#todo";
|
||||
removeGlobalFilter = true;
|
||||
@@ -419,6 +630,12 @@ in
|
||||
};
|
||||
};
|
||||
}
|
||||
{
|
||||
pkg = import ./plugins/url-into-selection { inherit pkgs; };
|
||||
options = {
|
||||
nothingSelected = 2;
|
||||
};
|
||||
}
|
||||
];
|
||||
|
||||
cssSnippets = [ ./snippets/file-explorer-separators.css ];
|
||||
@@ -449,7 +666,7 @@ in
|
||||
key = "T";
|
||||
}
|
||||
];
|
||||
"advanced-cursors:add-cursor-above" = [
|
||||
"editor:add-cursor-above" = [
|
||||
{
|
||||
modifiers = [
|
||||
"Mod"
|
||||
@@ -458,7 +675,7 @@ in
|
||||
key = "ArrowUp";
|
||||
}
|
||||
];
|
||||
"advanced-cursors:add-cursor-below" = [
|
||||
"editor:add-cursor-below" = [
|
||||
{
|
||||
modifiers = [
|
||||
"Mod"
|
||||
@@ -467,6 +684,8 @@ in
|
||||
key = "ArrowDown";
|
||||
}
|
||||
];
|
||||
"obsidian-outliner:move-list-item-up" = [ ];
|
||||
"obsidian-outliner:move-list-item-down" = [ ];
|
||||
};
|
||||
};
|
||||
};
|
||||
@@ -477,6 +696,8 @@ in
|
||||
}) hmConfig.programs.obsidian.vaults;
|
||||
};
|
||||
|
||||
sops.secrets."google/geocoding" = { };
|
||||
|
||||
home.persistence."/cache${userConfig.home}".directories = [ ".config/obsidian" ];
|
||||
};
|
||||
}
|
||||
|
@@ -79,33 +79,30 @@ in
|
||||
config.name = mkDefault (toCssName config.source);
|
||||
};
|
||||
|
||||
pluginsExtraFilesOptions =
|
||||
{ name, config, ... }:
|
||||
corePluginsOptions =
|
||||
{ config, ... }:
|
||||
{
|
||||
options = {
|
||||
source = mkOption {
|
||||
type = nullOr path;
|
||||
description = "Path of the source file or directory.";
|
||||
default = null;
|
||||
enable = mkOption {
|
||||
type = bool;
|
||||
default = true;
|
||||
description = "Whether to enable the plugin.";
|
||||
};
|
||||
|
||||
text = mkOption {
|
||||
type = nullOr str;
|
||||
description = "Text of the file.";
|
||||
default = null;
|
||||
name = mkOption {
|
||||
type = enum corePlugins;
|
||||
description = "The plugin.";
|
||||
};
|
||||
|
||||
target = mkOption {
|
||||
type = str;
|
||||
defaultText = literalExpression "name";
|
||||
description = "Path to target relative to the plugin directory.";
|
||||
options = mkOption {
|
||||
type = attrsOf anything;
|
||||
description = "Plugin options to include.";
|
||||
default = { };
|
||||
};
|
||||
};
|
||||
|
||||
config.target = mkDefault name;
|
||||
};
|
||||
|
||||
pluginsOptions =
|
||||
communityPluginsOptions =
|
||||
{ config, ... }:
|
||||
{
|
||||
options = {
|
||||
@@ -120,9 +117,9 @@ in
|
||||
description = "The plugin package.";
|
||||
};
|
||||
|
||||
extraFiles = mkOption {
|
||||
type = attrsOf (submodule pluginsExtraFilesOptions);
|
||||
description = "Additional files to include in the plugin directory.";
|
||||
options = mkOption {
|
||||
type = attrsOf anything;
|
||||
description = "Options to include in the plugin's `data.json`.";
|
||||
default = { };
|
||||
};
|
||||
};
|
||||
@@ -162,6 +159,31 @@ in
|
||||
};
|
||||
};
|
||||
|
||||
extraFilesOptions =
|
||||
{ name, config, ... }:
|
||||
{
|
||||
options = {
|
||||
source = mkOption {
|
||||
type = nullOr path;
|
||||
description = "Path of the source file or directory.";
|
||||
default = null;
|
||||
};
|
||||
|
||||
text = mkOption {
|
||||
type = nullOr str;
|
||||
description = "Text of the file.";
|
||||
default = null;
|
||||
};
|
||||
|
||||
target = mkOption {
|
||||
type = str;
|
||||
defaultText = literalExpression "name";
|
||||
description = "Path to target relative to the vault's directory.";
|
||||
};
|
||||
};
|
||||
|
||||
config.target = mkDefault name;
|
||||
};
|
||||
in
|
||||
{
|
||||
enable = mkEnableOption "obsidian";
|
||||
@@ -205,14 +227,14 @@ in
|
||||
];
|
||||
};
|
||||
|
||||
cssSnippets = mkOption {
|
||||
description = "CSS snippets to install.";
|
||||
communityPlugins = mkOption {
|
||||
description = "Community plugins to install and activate.";
|
||||
type = raw;
|
||||
default = [ ];
|
||||
};
|
||||
|
||||
plugins = mkOption {
|
||||
description = "Community plugins to install and activate.";
|
||||
cssSnippets = mkOption {
|
||||
description = "CSS snippets to install.";
|
||||
type = raw;
|
||||
default = [ ];
|
||||
};
|
||||
@@ -228,6 +250,12 @@ in
|
||||
type = raw;
|
||||
default = { };
|
||||
};
|
||||
|
||||
extraFiles = mkOption {
|
||||
description = "Extra files to link to the vault directory.";
|
||||
type = raw;
|
||||
default = { };
|
||||
};
|
||||
};
|
||||
|
||||
vaults = mkOption {
|
||||
@@ -264,22 +292,22 @@ in
|
||||
|
||||
corePlugins = mkOption {
|
||||
description = "Core plugins to activate.";
|
||||
type = listOf (enum corePlugins);
|
||||
type = listOf (either (enum corePlugins) (submodule corePluginsOptions));
|
||||
default = cfg.sharedSettings.corePlugins;
|
||||
};
|
||||
|
||||
communityPlugins = mkOption {
|
||||
description = "Community plugins to install and activate.";
|
||||
type = listOf (either package (submodule communityPluginsOptions));
|
||||
default = cfg.sharedSettings.communityPlugins;
|
||||
};
|
||||
|
||||
cssSnippets = mkOption {
|
||||
description = "CSS snippets to install.";
|
||||
type = listOf (either (addCheck path checkCssPath) (submodule cssSnippetsOptions));
|
||||
default = cfg.sharedSettings.cssSnippets;
|
||||
};
|
||||
|
||||
plugins = mkOption {
|
||||
description = "Community plugins to install and activate.";
|
||||
type = listOf (either package (submodule pluginsOptions));
|
||||
default = cfg.sharedSettings.plugins;
|
||||
};
|
||||
|
||||
themes = mkOption {
|
||||
description = "Themes to install.";
|
||||
type = listOf (either package (submodule themesOptions));
|
||||
@@ -291,6 +319,12 @@ in
|
||||
type = attrsOf (listOf (submodule hotkeysOptions));
|
||||
default = cfg.sharedSettings.hotkeys;
|
||||
};
|
||||
|
||||
extraFiles = mkOption {
|
||||
description = "Extra files to link to the vault directory.";
|
||||
type = attrsOf (submodule extraFilesOptions);
|
||||
default = cfg.sharedSettings.extraFiles;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
@@ -305,8 +339,10 @@ in
|
||||
config =
|
||||
let
|
||||
vaults = builtins.filter (vault: vault.enable == true) (builtins.attrValues cfg.vaults);
|
||||
toName = item: if item ? name then item.name else item;
|
||||
toPkg = item: if item ? pkg then item.pkg else item;
|
||||
isEnabled = item: if item ? enable then item.enable else true;
|
||||
hasOptions = item: item ? options;
|
||||
getCssName = item: if builtins.isAttrs item then item.name else toCssName item;
|
||||
getManifest =
|
||||
item:
|
||||
@@ -348,39 +384,48 @@ in
|
||||
};
|
||||
};
|
||||
|
||||
mkCorePlugins = vault: [
|
||||
{
|
||||
name = "${vault.target}/.obsidian/core-plugins.json";
|
||||
mkCorePlugins =
|
||||
vault:
|
||||
[
|
||||
{
|
||||
name = "${vault.target}/.obsidian/core-plugins.json";
|
||||
value = {
|
||||
source = (pkgs.formats.json { }).generate "core-plugins.json" (
|
||||
builtins.map toName vault.settings.corePlugins
|
||||
);
|
||||
};
|
||||
}
|
||||
{
|
||||
name = "${vault.target}/.obsidian/core-plugins-migration.json";
|
||||
value = {
|
||||
source = (pkgs.formats.json { }).generate "core-plugins-migration.json" (
|
||||
builtins.listToAttrs (
|
||||
builtins.map (name: {
|
||||
inherit name;
|
||||
value = builtins.any (
|
||||
plugin: name == (toName plugin) && isEnabled plugin
|
||||
) vault.settings.corePlugins;
|
||||
}) corePlugins
|
||||
)
|
||||
);
|
||||
};
|
||||
}
|
||||
]
|
||||
++ builtins.map (plugin: {
|
||||
name = "${vault.target}/.obsidian/${plugin.name}.json";
|
||||
value = {
|
||||
source = (pkgs.formats.json { }).generate "core-plugins.json" vault.settings.corePlugins;
|
||||
source = (pkgs.formats.json { }).generate "${plugin.name}.json" plugin.options;
|
||||
};
|
||||
}
|
||||
{
|
||||
name = "${vault.target}/.obsidian/core-plugins-migration.json";
|
||||
value = {
|
||||
source = (pkgs.formats.json { }).generate "core-plugins-migration.json" (
|
||||
builtins.listToAttrs (
|
||||
builtins.map (plugin: {
|
||||
name = plugin;
|
||||
value = builtins.elem plugin vault.settings.corePlugins;
|
||||
}) vault.settings.corePlugins
|
||||
)
|
||||
);
|
||||
};
|
||||
}
|
||||
];
|
||||
}) (builtins.filter hasOptions vault.settings.corePlugins);
|
||||
|
||||
mkCommunityPlugins =
|
||||
vault:
|
||||
let
|
||||
enabledPlugins = builtins.filter isEnabled vault.settings.plugins;
|
||||
in
|
||||
[
|
||||
{
|
||||
name = "${vault.target}/.obsidian/community-plugins.json";
|
||||
value = {
|
||||
source = (pkgs.formats.json { }).generate "community-plugins.json" (
|
||||
builtins.map getManifest enabledPlugins
|
||||
builtins.map getManifest (builtins.filter isEnabled vault.settings.communityPlugins)
|
||||
);
|
||||
};
|
||||
}
|
||||
@@ -391,14 +436,13 @@ in
|
||||
source = toPkg plugin;
|
||||
recursive = true;
|
||||
};
|
||||
}) vault.settings.plugins
|
||||
++ builtins.map (
|
||||
plugin:
|
||||
builtins.map (file: {
|
||||
name = "${vault.target}/.obsidian/plugins/${getManifest plugin}/${file.target}";
|
||||
value = if file.source != null then { inherit (file) source; } else { inherit (file) text; };
|
||||
}) (builtins.attrValues (plugin.extraFiles or { }))
|
||||
) vault.settings.plugins;
|
||||
}) vault.settings.communityPlugins
|
||||
++ builtins.map (plugin: {
|
||||
name = "${vault.target}/.obsidian/plugins/${getManifest plugin}/data.json";
|
||||
value = {
|
||||
source = (pkgs.formats.json { }).generate "data.json" plugin.options;
|
||||
};
|
||||
}) (builtins.filter hasOptions vault.settings.communityPlugins);
|
||||
|
||||
mkCssSnippets =
|
||||
vault:
|
||||
@@ -426,6 +470,13 @@ in
|
||||
source = (pkgs.formats.json { }).generate "hotkeys.json" vault.settings.hotkeys;
|
||||
};
|
||||
};
|
||||
|
||||
mkExtraFiles =
|
||||
vault:
|
||||
builtins.map (file: {
|
||||
name = "${vault.target}/.obsidian/${file.target}";
|
||||
value = if file.source != null then { inherit (file) source; } else { inherit (file) text; };
|
||||
}) (builtins.attrValues vault.settings.extraFiles);
|
||||
in
|
||||
builtins.listToAttrs (
|
||||
lib.lists.flatten (
|
||||
@@ -437,6 +488,7 @@ in
|
||||
(mkCssSnippets vault)
|
||||
(mkThemes vault)
|
||||
(mkHotkeys vault)
|
||||
(mkExtraFiles vault)
|
||||
]) vaults
|
||||
)
|
||||
);
|
||||
@@ -467,12 +519,9 @@ in
|
||||
{
|
||||
assertion = builtins.all (
|
||||
vault:
|
||||
builtins.all (
|
||||
plugin:
|
||||
builtins.all (file: file.source == null || file.text == null) (
|
||||
builtins.attrValues (plugin.extraFiles or { })
|
||||
)
|
||||
) vault.settings.plugins
|
||||
builtins.all (file: file.source == null || file.text == null) (
|
||||
builtins.attrValues vault.settings.extraFiles
|
||||
)
|
||||
) (builtins.attrValues cfg.vaults);
|
||||
message = "Only one of `source` and `text` must be set";
|
||||
}
|
||||
|
@@ -0,0 +1,30 @@
|
||||
{
|
||||
pkgs ? import <nixpkgs> { },
|
||||
...
|
||||
}:
|
||||
pkgs.buildNpmPackage rec {
|
||||
pname = "obsidian.plugins.better-word-count";
|
||||
version = "0.10.1";
|
||||
|
||||
src = pkgs.fetchFromGitHub {
|
||||
owner = "karaolidis";
|
||||
rev = "8ff00d7e9aed03d8cf38215b742a2a2251cc2ea2";
|
||||
# owner = "lukeleppan";
|
||||
repo = "better-word-count";
|
||||
# rev = "${version}";
|
||||
hash = "sha256-wA0vycuUHr7icgAJ/d85j3bbwqlefXnSyRUXgCmqyOE=";
|
||||
};
|
||||
|
||||
patches = [ ./package-lock.patch ];
|
||||
makeCacheWritable = true;
|
||||
|
||||
npmDepsHash = "sha256-K+NGIKsSNzGHGcAofsl0WcNsTFt/y38zUdGUZL013xg=";
|
||||
npmPackFlags = [ "--ignore-scripts" ];
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out
|
||||
cp ./manifest.json $out/manifest.json
|
||||
cp ./dist/main.js $out/main.js
|
||||
cp ./src/styles.css $out/styles.css
|
||||
'';
|
||||
}
|
@@ -0,0 +1,35 @@
|
||||
diff --git a/package-lock.json b/package-lock.json
|
||||
index 3fa99a5..71302ec 100644
|
||||
--- a/package-lock.json
|
||||
+++ b/package-lock.json
|
||||
@@ -15,7 +15,7 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@codemirror/commands": "^6.1.2",
|
||||
- "@codemirror/language": "https://github.com/lishid/cm-language",
|
||||
+ "@codemirror/language": "https://github.com/karaolidis/cm-language#package-lock",
|
||||
"@codemirror/search": "^6.2.2",
|
||||
"@codemirror/state": "^6.1.2",
|
||||
"@codemirror/view": "^6.4.0",
|
||||
@@ -49,7 +49,7 @@
|
||||
},
|
||||
"node_modules/@codemirror/language": {
|
||||
"version": "6.10.1",
|
||||
- "resolved": "git+ssh://git@github.com/lishid/cm-language.git#2644bfc27afda707a7e1f3aedaf3ca7120f63cd9",
|
||||
+ "resolved": "git+ssh://git@github.com/karaolidis/cm-language.git#d6238f0a9e17e20d604cee67a47d3a93b00dd41c",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@codemirror/state": "^6.0.0",
|
||||
diff --git a/package.json b/package.json
|
||||
index 2537f1e..ba6bfff 100644
|
||||
--- a/package.json
|
||||
+++ b/package.json
|
||||
@@ -24,7 +24,7 @@
|
||||
"license": "MIT",
|
||||
"devDependencies": {
|
||||
"@codemirror/commands": "^6.1.2",
|
||||
- "@codemirror/language": "https://github.com/lishid/cm-language",
|
||||
+ "@codemirror/language": "https://github.com/karaolidis/cm-language#package-lock",
|
||||
"@codemirror/search": "^6.2.2",
|
||||
"@codemirror/state": "^6.1.2",
|
||||
"@codemirror/view": "^6.4.0",
|
@@ -0,0 +1,27 @@
|
||||
{
|
||||
pkgs ? import <nixpkgs> { },
|
||||
...
|
||||
}:
|
||||
pkgs.buildNpmPackage rec {
|
||||
pname = "obsidian.plugins.folder-note";
|
||||
version = "0.7.3";
|
||||
|
||||
src = pkgs.fetchFromGitHub {
|
||||
owner = "karaolidis";
|
||||
rev = "2d14ccb5179beb48c3df87108170aeda067584ac";
|
||||
# owner = "xpgo";
|
||||
repo = "obsidian-folder-note-plugin";
|
||||
# rev = "${version}";
|
||||
hash = "sha256-Ub0u+hMbkzxeUjzVmA61S0ClXR9E3KrYTqhrJBQj0Wg=";
|
||||
};
|
||||
|
||||
npmDepsHash = "sha256-4v6QwwooxsXy+mbiKriylpKa8NOK8pWZixezY+H6wxo=";
|
||||
npmPackFlags = [ "--ignore-scripts" ];
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out
|
||||
cp ./manifest.json $out/manifest.json
|
||||
cp ./main.js $out/main.js
|
||||
cp ./styles.css $out/styles.css
|
||||
'';
|
||||
}
|
@@ -0,0 +1,38 @@
|
||||
{
|
||||
pkgs ? import <nixpkgs> { },
|
||||
...
|
||||
}:
|
||||
pkgs.stdenv.mkDerivation rec {
|
||||
pname = "obsidian.plugins.languagetool";
|
||||
version = "0.3.7";
|
||||
|
||||
src = pkgs.fetchFromGitHub {
|
||||
owner = "karaolidis";
|
||||
rev = "a7bb62f767decbd55b14702c35e24954459e77ca";
|
||||
# owner = "Clemens-E";
|
||||
repo = "obsidian-languagetool-plugin";
|
||||
# rev = "${version}";
|
||||
hash = "sha256-LeSK9ctdKW6P3AoOWHxHmGxIlOXDOVd1nhsWXdRSiZY=";
|
||||
};
|
||||
|
||||
patches = [ ./settings-notification.patch ];
|
||||
|
||||
offlineCache = pkgs.fetchYarnDeps {
|
||||
yarnLock = src + "/yarn.lock";
|
||||
hash = "sha256-749RGQmg9Mte7TR6k3qP6xcb8+rj/C60LYLbF8j8gNc=";
|
||||
};
|
||||
|
||||
nativeBuildInputs = with pkgs; [
|
||||
nodejs
|
||||
yarnConfigHook
|
||||
yarnBuildHook
|
||||
npmHooks.npmInstallHook
|
||||
];
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out
|
||||
cp ./manifest.json $out/manifest.json
|
||||
cp ./main.js $out/main.js
|
||||
cp ./styles.css $out/styles.css
|
||||
'';
|
||||
}
|
@@ -0,0 +1,12 @@
|
||||
diff --git a/src/index.ts b/src/index.ts
|
||||
index 00cccfe..43e6107 100644
|
||||
--- a/src/index.ts
|
||||
+++ b/src/index.ts
|
||||
@@ -42,7 +42,6 @@ export default class LanguageToolPlugin extends Plugin {
|
||||
try {
|
||||
await this.saveSettings();
|
||||
await this.loadSettings();
|
||||
- new Notice('updated LanguageTool Settings, please confirm your server URL in the settings tab', 10000);
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
}
|
@@ -0,0 +1,27 @@
|
||||
{
|
||||
pkgs ? import <nixpkgs> { },
|
||||
...
|
||||
}:
|
||||
pkgs.buildNpmPackage rec {
|
||||
pname = "obsidian.plugins.map-view";
|
||||
version = "5.0.2";
|
||||
|
||||
src = pkgs.fetchFromGitHub {
|
||||
owner = "karaolidis";
|
||||
rev = "22e13b87e43dc5a5e40240e7de216ed8f638e741";
|
||||
# owner = "esm7";
|
||||
repo = "obsidian-map-view";
|
||||
# rev = "${version}";
|
||||
hash = "sha256-n++PIWsaxAFnbfzlD0sWMs5+ljOXjA+ft6d/m/p2oq8=";
|
||||
};
|
||||
|
||||
npmDepsHash = "sha256-AzJfluB+KjGudESedQxX4BxStnELeFDHO+h+f73ihuA=";
|
||||
npmPackFlags = [ "--ignore-scripts" ];
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out
|
||||
cp ./dist/manifest.json $out/manifest.json
|
||||
cp ./dist/main.js $out/main.js
|
||||
cp ./dist/styles.css $out/styles.css
|
||||
'';
|
||||
}
|
@@ -0,0 +1,24 @@
|
||||
{
|
||||
pkgs ? import <nixpkgs> { },
|
||||
...
|
||||
}:
|
||||
pkgs.buildNpmPackage rec {
|
||||
pname = "obsidian.plugins.read-it-later";
|
||||
version = "0.4.0";
|
||||
|
||||
src = pkgs.fetchFromGitHub {
|
||||
owner = "DominikPieper";
|
||||
repo = "obsidian-ReadItLater";
|
||||
rev = "${version}";
|
||||
hash = "sha256-yaEgYH9jfjumZJ/kD/jj2NDTsuvP6EmyfYXEj5E8Q0Q=";
|
||||
};
|
||||
|
||||
npmDepsHash = "sha256-OOhdusXBbxSl8S2uCGTqkTDYEbO5FxOlH8cehwU3LjY=";
|
||||
npmPackFlags = [ "--ignore-scripts" ];
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out
|
||||
cp ./manifest.json $out/manifest.json
|
||||
cp ./main.js $out/main.js
|
||||
'';
|
||||
}
|
@@ -7,8 +7,6 @@ pkgs.stdenv.mkDerivation rec {
|
||||
version = "1.0.8";
|
||||
|
||||
src = pkgs.fetchFromGitHub {
|
||||
# owner = "karaolidis";
|
||||
# rev = "d4bbe50b8d4c481bfe72650e1c76bf643738e177";
|
||||
owner = "mgmeyers";
|
||||
repo = "obsidian-style-settings";
|
||||
rev = "${version}";
|
||||
|
@@ -0,0 +1,26 @@
|
||||
{
|
||||
pkgs ? import <nixpkgs> { },
|
||||
...
|
||||
}:
|
||||
pkgs.buildNpmPackage rec {
|
||||
pname = "obsidian.plugins.url-into-selection";
|
||||
version = "1.7.0";
|
||||
|
||||
src = pkgs.fetchFromGitHub {
|
||||
owner = "karaolidis";
|
||||
rev = "9f85d59be28797b7ef16c452fa3c4093f60b3bab";
|
||||
# owner = "denolehov";
|
||||
repo = "obsidian-url-into-selection";
|
||||
# rev = "${version}";
|
||||
hash = "sha256-MQV8CMzCha0MUGLh4c1WuHVXRiCPEwtSgd3Xoj/81hA=";
|
||||
};
|
||||
|
||||
npmDepsHash = "sha256-tThyrhezHZ29JUzx5sy2SfoZIGYP0DOQBctxYB5O1P4=";
|
||||
npmPackFlags = [ "--ignore-scripts" ];
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out
|
||||
cp ./manifest.json $out/manifest.json
|
||||
cp ./main.js $out/main.js
|
||||
'';
|
||||
}
|
Reference in New Issue
Block a user