Reorganize imports
Signed-off-by: Nikolaos Karaolidis <nick@karaolidis.com>
This commit is contained in:
720
hosts/common/configs/user/gui/obsidian/default.nix
Normal file
720
hosts/common/configs/user/gui/obsidian/default.nix
Normal file
@@ -0,0 +1,720 @@
|
||||
{
|
||||
user ? throw "user argument is required",
|
||||
home ? throw "home argument is required",
|
||||
}:
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
hmConfig = config.home-manager.users.${user};
|
||||
in
|
||||
{
|
||||
environment.persistence."/cache"."${home}/.config/obsidian" = { };
|
||||
|
||||
home-manager.users.${user} = {
|
||||
imports = [ ./options.nix ];
|
||||
|
||||
programs.obsidian = {
|
||||
enable = true;
|
||||
|
||||
sharedSettings = {
|
||||
app = {
|
||||
defaultViewMode = "preview";
|
||||
livePreview = false;
|
||||
readableLineLength = true;
|
||||
showLineNumber = true;
|
||||
tabSize = 2;
|
||||
promptDelete = false;
|
||||
trashOption = "local";
|
||||
alwaysUpdateLinks = true;
|
||||
newFileLocation = "folder";
|
||||
newFileFolderPath = "inbox";
|
||||
newLinkFormat = "absolute";
|
||||
showUnsupportedFiles = true;
|
||||
attachmentFolderPath = "./assets";
|
||||
};
|
||||
|
||||
corePlugins = [
|
||||
"bookmarks"
|
||||
{
|
||||
name = "canvas";
|
||||
options = {
|
||||
newFileLocation = "folder";
|
||||
newFileFolderPath = "Inbox";
|
||||
defaultWheelBehavior = "zoom";
|
||||
};
|
||||
}
|
||||
"canvas"
|
||||
{
|
||||
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"
|
||||
"graph"
|
||||
"note-composer"
|
||||
"outgoing-link"
|
||||
"outline"
|
||||
"page-preview"
|
||||
"slash-command"
|
||||
"switcher"
|
||||
"tag-pane"
|
||||
];
|
||||
|
||||
communityPlugins = [
|
||||
{
|
||||
pkg = pkgs.callPackage ./config/plugins/better-word-count { };
|
||||
options = {
|
||||
statusBar = [
|
||||
{
|
||||
prefix = "";
|
||||
suffix = " words";
|
||||
metric = {
|
||||
type = 0;
|
||||
counter = 0;
|
||||
};
|
||||
}
|
||||
];
|
||||
altBar = [
|
||||
{
|
||||
prefix = "";
|
||||
suffix = " files";
|
||||
metric = {
|
||||
type = 2;
|
||||
counter = 6;
|
||||
};
|
||||
}
|
||||
];
|
||||
countComments = true; # Inverse
|
||||
};
|
||||
}
|
||||
{
|
||||
pkg = pkgs.callPackage ./config/plugins/custom-sort { };
|
||||
options = {
|
||||
suspended = false;
|
||||
statusBarEntryEnabled = false;
|
||||
notificationsEnabled = false;
|
||||
customSortContextSubmenu = false;
|
||||
bookmarksGroupToConsumeAsOrderingReference = "Sort";
|
||||
bookmarksContextMenus = false;
|
||||
};
|
||||
}
|
||||
{
|
||||
pkg = pkgs.callPackage ./config/plugins/dataview { };
|
||||
options = {
|
||||
enableDataviewJs = true;
|
||||
enableInlineDataviewJs = true;
|
||||
warnOnEmptyResult = false;
|
||||
defaultDateFormat = "dd/MM/yyyy";
|
||||
defaultDateTimeFormat = "HH:mm - dd/MM/yyyy";
|
||||
};
|
||||
}
|
||||
{
|
||||
pkg = pkgs.callPackage ./config/plugins/excalidraw { };
|
||||
options = {
|
||||
folder = "Inbox";
|
||||
templateFilePath = "Templates";
|
||||
scriptFolderPath = "Scripts";
|
||||
compress = false;
|
||||
drawingFilenamePrefix = "";
|
||||
drawingEmbedPrefixWithFilename = false;
|
||||
drawingFilenameDateTime = "YYYY-MM-DD-HH.mm.ss";
|
||||
previewImageType = "SVG";
|
||||
previewMatchObsidianTheme = true;
|
||||
defaultPenMode = "mobile";
|
||||
parseTODO = true;
|
||||
focusOnFileTab = true;
|
||||
pngExportScale = 2;
|
||||
exportWithTheme = false;
|
||||
exportWithBackground = false;
|
||||
exportEmbedScene = true;
|
||||
showReleaseNotes = false;
|
||||
showNewVersionNotification = false;
|
||||
};
|
||||
}
|
||||
{
|
||||
pkg = pkgs.callPackage ./config/plugins/folder-note { };
|
||||
options = {
|
||||
folderNoteHide = false;
|
||||
folderNoteStrInit = "";
|
||||
};
|
||||
}
|
||||
{
|
||||
pkg = pkgs.callPackage ./config/plugins/kanban { };
|
||||
options = {
|
||||
move-tags = true;
|
||||
move-dates = true;
|
||||
date-display-format = "DD/MM/YYYY";
|
||||
show-relative-date = true;
|
||||
date-picker-week-start = 1;
|
||||
inline-metadata-position = "footer";
|
||||
move-task-metadata = true;
|
||||
show-archive-all = false;
|
||||
show-board-settings = false;
|
||||
};
|
||||
}
|
||||
{
|
||||
pkg = pkgs.callPackage ./config/plugins/languagetool { };
|
||||
options = {
|
||||
shouldAutoCheck = true;
|
||||
pickyMode = true;
|
||||
staticLanguage = "auto";
|
||||
englishVariety = "en-US";
|
||||
};
|
||||
}
|
||||
{
|
||||
pkg = pkgs.callPackage ./config/plugins/linter { };
|
||||
options = {
|
||||
lintOnSave = true;
|
||||
displayChanged = false;
|
||||
lintOnFileChange = true;
|
||||
ruleConfigs = {
|
||||
add-blank-line-after-yaml.enabled = true;
|
||||
dedupe-yaml-array-values.enabled = true;
|
||||
escape-yaml-special-characters = {
|
||||
enabled = true;
|
||||
try-to-escape-single-line-arrays = true;
|
||||
};
|
||||
format-tags-in-yaml.enabled = true;
|
||||
format-yaml-array = {
|
||||
enabled = true;
|
||||
default-array-style = "multi-line";
|
||||
};
|
||||
sort-yaml-array-values.enabled = true;
|
||||
capitalize-headings = {
|
||||
enabled = true;
|
||||
ignore-words = "";
|
||||
};
|
||||
header-increment = {
|
||||
enabled = true;
|
||||
start-at-h2 = true;
|
||||
};
|
||||
headings-start-line.enabled = true;
|
||||
remove-trailing-punctuation-in-heading.enabled = true;
|
||||
auto-correct-common-misspellings.enabled = true;
|
||||
blockquote-style.enabled = true;
|
||||
convert-bullet-list-markers.enabled = true;
|
||||
emphasis-style = {
|
||||
enabled = true;
|
||||
style = "asterisk";
|
||||
};
|
||||
no-bare-urls = {
|
||||
enabled = true;
|
||||
no-bare-uris = true;
|
||||
};
|
||||
ordered-list-style.enabled = true;
|
||||
quote-style.enabled = true;
|
||||
remove-consecutive-list-markers.enabled = true;
|
||||
remove-empty-list-markers.enabled = true;
|
||||
remove-hyphenated-line-breaks.enabled = true;
|
||||
remove-multiple-spaces.enabled = true;
|
||||
strong-style = {
|
||||
enabled = true;
|
||||
style = "asterisk";
|
||||
};
|
||||
two-spaces-between-lines-with-content.enabled = true;
|
||||
unordered-list-style = {
|
||||
enabled = true;
|
||||
list-style = "-";
|
||||
};
|
||||
compact-yaml = {
|
||||
enabled = true;
|
||||
inner-new-lines = true;
|
||||
};
|
||||
consecutive-blank-lines.enabled = true;
|
||||
empty-line-around-blockquotes.enabled = true;
|
||||
empty-line-around-code-fences.enabled = true;
|
||||
empty-line-around-math-blocks.enabled = true;
|
||||
empty-line-around-tables.enabled = true;
|
||||
heading-blank-lines.enabled = true;
|
||||
line-break-at-document-end.enabled = true;
|
||||
move-math-block-indicators-to-their-own-line.enabled = true;
|
||||
paragraph-blank-lines.enabled = true;
|
||||
remove-empty-lines-between-list-markers-and-checklists.enabled = true;
|
||||
remove-link-spacing.enabled = true;
|
||||
space-after-list-markers.enabled = true;
|
||||
trailing-spaces.enabled = true;
|
||||
add-blockquote-indentation-on-paste.enabled = true;
|
||||
prevent-double-checklist-indicator-on-paste.enabled = true;
|
||||
prevent-double-list-item-indicator-on-paste.enabled = true;
|
||||
remove-hyphens-on-paste.enabled = true;
|
||||
remove-leading-or-trailing-whitespace-on-paste.enabled = true;
|
||||
remove-leftover-footnotes-from-quote-on-paste.enabled = true;
|
||||
remove-multiple-blank-lines-on-paste.enabled = true;
|
||||
};
|
||||
customRegexes = [
|
||||
{
|
||||
label = "Open Double Quote";
|
||||
find = "“";
|
||||
replace = "\"";
|
||||
flags = "gm";
|
||||
}
|
||||
{
|
||||
label = "Close Double Quote";
|
||||
find = "”";
|
||||
replace = "\"";
|
||||
flags = "gm";
|
||||
}
|
||||
{
|
||||
label = "Elipsis";
|
||||
find = "…";
|
||||
replace = "...";
|
||||
flags = "gm";
|
||||
}
|
||||
{
|
||||
label = "Open Quote";
|
||||
find = "‘";
|
||||
replace = "'";
|
||||
flags = "gm";
|
||||
}
|
||||
{
|
||||
label = "Close Quote";
|
||||
find = "’";
|
||||
replace = "'";
|
||||
flags = "gm";
|
||||
}
|
||||
{
|
||||
label = "Long Dash";
|
||||
find = "—";
|
||||
replace = "---";
|
||||
flags = "gm";
|
||||
}
|
||||
{
|
||||
label = "Short Dash";
|
||||
find = "–";
|
||||
replace = "--";
|
||||
flags = "gm";
|
||||
}
|
||||
{
|
||||
label = "Long Dash with Text";
|
||||
find = "([^\\s])---([^\\s])";
|
||||
replace = "$1 --- $2";
|
||||
flags = "gm";
|
||||
}
|
||||
{
|
||||
label = "Short Dash with Text";
|
||||
find = "([^\\s])--([^\\s])";
|
||||
replace = "$1 -- $2";
|
||||
flags = "gm";
|
||||
}
|
||||
];
|
||||
commonStyles = {
|
||||
removeUnnecessaryEscapeCharsForMultiLineArrays = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
{
|
||||
pkg = pkgs.callPackage ./config/plugins/map-view { };
|
||||
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 = pkgs.callPackage ./config/plugins/minimal-settings { };
|
||||
options = {
|
||||
editorFont = "var(--font-monospace)";
|
||||
};
|
||||
}
|
||||
{
|
||||
pkg = pkgs.callPackage ./config/plugins/outliner { };
|
||||
options = {
|
||||
styleLists = false;
|
||||
stickCursor = "never";
|
||||
};
|
||||
}
|
||||
{
|
||||
pkg = pkgs.callPackage ./config/plugins/read-it-later { };
|
||||
options = {
|
||||
inboxDir = "Inbox";
|
||||
assetsDir = "Inbox/assets";
|
||||
openNewNote = true;
|
||||
youtubeNote = ''
|
||||
---
|
||||
source: %videoURL%
|
||||
---
|
||||
|
||||
%videoPlayer%
|
||||
'';
|
||||
vimeoNote = ''
|
||||
---
|
||||
source: %videoURL%
|
||||
---
|
||||
|
||||
%videoPlayer%
|
||||
'';
|
||||
bilibiliNote = ''
|
||||
---
|
||||
source: %videoURL%
|
||||
---
|
||||
|
||||
%videoPlayer%
|
||||
'';
|
||||
twitterNote = ''
|
||||
---
|
||||
source: %tweetURL%
|
||||
---
|
||||
|
||||
%tweetContent%
|
||||
'';
|
||||
parsableArticleNote = ''
|
||||
---
|
||||
source: %articleURL%
|
||||
---
|
||||
|
||||
%articleContent%
|
||||
'';
|
||||
mastodonNote = ''
|
||||
---
|
||||
source: %tootURL%
|
||||
---
|
||||
|
||||
> %tootContent%
|
||||
'';
|
||||
stackExchangeNote = ''
|
||||
---
|
||||
source: %questionURL%
|
||||
---
|
||||
|
||||
Author: [%authorName%](%authorProfileURL%)
|
||||
|
||||
%questionContent%
|
||||
|
||||
***
|
||||
|
||||
%topAnswer%
|
||||
|
||||
%answers%
|
||||
'';
|
||||
stackExchangeAnswer = ''
|
||||
Answered by: [%authorName%](%authorProfileURL%)
|
||||
|
||||
> %answerContent%
|
||||
'';
|
||||
tikTokNote = ''
|
||||
---
|
||||
source: %videoURL%
|
||||
---
|
||||
|
||||
%videoDescription%
|
||||
|
||||
%videoPlayer%
|
||||
'';
|
||||
notParsableArticleNote = ''
|
||||
---
|
||||
source: %articleURL%
|
||||
---
|
||||
|
||||
%previewURL%
|
||||
'';
|
||||
textSnippetNote = "%content%";
|
||||
};
|
||||
}
|
||||
(pkgs.callPackage ./config/plugins/style-settings { })
|
||||
{
|
||||
pkg = pkgs.callPackage ./config/plugins/tasks { };
|
||||
options = {
|
||||
globalQuery = "short mode";
|
||||
globalFilter = "#todo";
|
||||
removeGlobalFilter = true;
|
||||
setCreatedDate = true;
|
||||
statusSettings = {
|
||||
coreStatuses = [
|
||||
{
|
||||
symbol = " ";
|
||||
name = "to-do";
|
||||
nextStatusSymbol = "/";
|
||||
type = "TODO";
|
||||
}
|
||||
{
|
||||
symbol = "x";
|
||||
name = "done";
|
||||
nextStatusSymbol = " ";
|
||||
type = "DONE";
|
||||
}
|
||||
];
|
||||
customStatuses = [
|
||||
{
|
||||
symbol = "/";
|
||||
name = "in-progress";
|
||||
nextStatusSymbol = "x";
|
||||
type = "IN_PROGRESS";
|
||||
}
|
||||
{
|
||||
symbol = "-";
|
||||
name = "canceled";
|
||||
nextStatusSymbol = " ";
|
||||
type = "CANCELLED";
|
||||
}
|
||||
{
|
||||
symbol = ">";
|
||||
name = "forwarded";
|
||||
nextStatusSymbol = "/";
|
||||
type = "IN_PROGRESS";
|
||||
}
|
||||
{
|
||||
symbol = "<";
|
||||
name = "scheduling";
|
||||
nextStatusSymbol = "/";
|
||||
type = "TODO";
|
||||
}
|
||||
{
|
||||
symbol = "?";
|
||||
name = "question";
|
||||
nextStatusSymbol = " ";
|
||||
type = "TODO";
|
||||
}
|
||||
{
|
||||
symbol = "!";
|
||||
name = "important";
|
||||
nextStatusSymbol = " ";
|
||||
type = "TODO";
|
||||
}
|
||||
{
|
||||
symbol = "*";
|
||||
name = "star";
|
||||
nextStatusSymbol = " ";
|
||||
type = "TODO";
|
||||
}
|
||||
{
|
||||
symbol = "\"";
|
||||
name = "quote";
|
||||
nextStatusSymbol = " ";
|
||||
type = "TODO";
|
||||
}
|
||||
{
|
||||
symbol = "l";
|
||||
name = "location";
|
||||
nextStatusSymbol = " ";
|
||||
type = "TODO";
|
||||
}
|
||||
{
|
||||
symbol = "b";
|
||||
name = "bookmark";
|
||||
nextStatusSymbol = " ";
|
||||
type = "TODO";
|
||||
}
|
||||
{
|
||||
symbol = "i";
|
||||
name = "information";
|
||||
nextStatusSymbol = " ";
|
||||
type = "TODO";
|
||||
}
|
||||
{
|
||||
symbol = "S";
|
||||
name = "savings";
|
||||
nextStatusSymbol = " ";
|
||||
type = "TODO";
|
||||
}
|
||||
{
|
||||
symbol = "I";
|
||||
name = "idea";
|
||||
nextStatusSymbol = " ";
|
||||
type = "TODO";
|
||||
}
|
||||
{
|
||||
symbol = "p";
|
||||
name = "pros";
|
||||
nextStatusSymbol = " ";
|
||||
type = "TODO";
|
||||
}
|
||||
{
|
||||
symbol = "c";
|
||||
name = "cons";
|
||||
nextStatusSymbol = " ";
|
||||
type = "TODO";
|
||||
}
|
||||
{
|
||||
symbol = "f";
|
||||
name = "fire";
|
||||
nextStatusSymbol = " ";
|
||||
type = "TODO";
|
||||
}
|
||||
{
|
||||
symbol = "k";
|
||||
name = "key";
|
||||
nextStatusSymbol = " ";
|
||||
type = "TODO";
|
||||
}
|
||||
{
|
||||
symbol = "w";
|
||||
name = "win";
|
||||
nextStatusSymbol = " ";
|
||||
type = "TODO";
|
||||
}
|
||||
{
|
||||
symbol = "u";
|
||||
name = "up";
|
||||
nextStatusSymbol = " ";
|
||||
type = "TODO";
|
||||
}
|
||||
{
|
||||
symbol = "d";
|
||||
name = "down";
|
||||
nextStatusSymbol = " ";
|
||||
type = "TODO";
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
(pkgs.callPackage ./config/plugins/url-into-selection { })
|
||||
];
|
||||
|
||||
cssSnippets = [ ./config/snippets/file-explorer-separators.css ];
|
||||
|
||||
themes = [ (pkgs.callPackage ./config/themes/minimal { }) ];
|
||||
|
||||
hotkeys = {
|
||||
"command-palette:open" = [ { key = "F1"; } ];
|
||||
"app:open-help" = [ ];
|
||||
"editor:swap-line-down" = [
|
||||
{
|
||||
modifiers = [ "Alt" ];
|
||||
key = "ArrowDown";
|
||||
}
|
||||
];
|
||||
"editor:swap-line-up" = [
|
||||
{
|
||||
modifiers = [ "Alt" ];
|
||||
key = "ArrowUp";
|
||||
}
|
||||
];
|
||||
"editor:fold-all" = [
|
||||
{
|
||||
modifiers = [
|
||||
"Alt"
|
||||
"Mod"
|
||||
];
|
||||
key = "T";
|
||||
}
|
||||
];
|
||||
"editor:add-cursor-above" = [
|
||||
{
|
||||
modifiers = [
|
||||
"Mod"
|
||||
"Shift"
|
||||
];
|
||||
key = "ArrowUp";
|
||||
}
|
||||
];
|
||||
"editor:add-cursor-below" = [
|
||||
{
|
||||
modifiers = [
|
||||
"Mod"
|
||||
"Shift"
|
||||
];
|
||||
key = "ArrowDown";
|
||||
}
|
||||
];
|
||||
"obsidian-outliner:move-list-item-up" = [ ];
|
||||
"obsidian-outliner:move-list-item-down" = [ ];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
theme.template = lib.attrsets.mapAttrs' (
|
||||
_: vault:
|
||||
lib.attrsets.nameValuePair
|
||||
"${home}/${vault.target}/.obsidian/plugins/obsidian-style-settings/data.json"
|
||||
{
|
||||
source = ./theme.json;
|
||||
}
|
||||
) hmConfig.programs.obsidian.vaults;
|
||||
|
||||
sops.secrets."google/geocoding".sopsFile = ../../../../../../secrets/personal/secrets.yaml;
|
||||
|
||||
wayland.windowManager.hyprland.settings.bind = [ "$mod, o, exec, ${pkgs.obsidian}/bin/obsidian" ];
|
||||
};
|
||||
}
|
Reference in New Issue
Block a user