81 lines
2.1 KiB
Nix
81 lines
2.1 KiB
Nix
{
|
|
user ? throw "user argument is required",
|
|
}:
|
|
{
|
|
config,
|
|
lib,
|
|
pkgs,
|
|
...
|
|
}:
|
|
let
|
|
hmConfig = config.home-manager.users.${user.name};
|
|
in
|
|
{
|
|
home-manager.users.${user.name} = {
|
|
imports = [ ./options.nix ];
|
|
|
|
programs = {
|
|
obsidian = {
|
|
enable = true;
|
|
|
|
sharedSettings = {
|
|
app = {
|
|
defaultViewMode = "preview";
|
|
livePreview = false;
|
|
readableLineLength = false;
|
|
showLineNumber = true;
|
|
tabSize = 2;
|
|
promptDelete = false;
|
|
trashOption = "local";
|
|
alwaysUpdateLinks = true;
|
|
newFileLocation = "folder";
|
|
newFileFolderPath = "inbox";
|
|
newLinkFormat = "absolute";
|
|
showUnsupportedFiles = true;
|
|
attachmentFolderPath = "./assets";
|
|
};
|
|
|
|
corePlugins = [
|
|
"bookmarks"
|
|
"canvas"
|
|
"command-palette"
|
|
"editor-status"
|
|
"file-explorer"
|
|
"global-search"
|
|
"graph"
|
|
"note-composer"
|
|
"outgoing-link"
|
|
"outline"
|
|
"page-preview"
|
|
"slash-command"
|
|
"switcher"
|
|
"tag-pane"
|
|
];
|
|
|
|
plugins = [
|
|
(import ./plugins/style-settings.nix { inherit pkgs; })
|
|
{
|
|
pkg = import ./plugins/minimal-settings.nix { inherit pkgs; };
|
|
extraFiles."data.json".source = (pkgs.formats.json { }).generate "data.json" {
|
|
labeledNav = true;
|
|
editorFont = "var(--font-monospace)";
|
|
};
|
|
}
|
|
];
|
|
|
|
cssSnippets = [ ./snippets/file-explorer-separators.css ];
|
|
|
|
themes = [ (import ./themes/minimal.nix { inherit pkgs; }) ];
|
|
};
|
|
};
|
|
|
|
matugen.settings.templates = builtins.mapAttrs (name: _: {
|
|
input_path = ./theme.json;
|
|
output_path = "${user.home}/${name}/.obsidian/plugins/obsidian-style-settings/data.json";
|
|
}) hmConfig.programs.obsidian.vaults;
|
|
};
|
|
|
|
home.persistence."/cache${user.home}".directories = [ ".config/obsidian" ];
|
|
};
|
|
}
|