81 lines
2.0 KiB
Nix
81 lines
2.0 KiB
Nix
{ config, ... }:
|
|
let
|
|
homeModules = config.flake.modules.homeManager;
|
|
in
|
|
{
|
|
flake.modules.homeManager.notes =
|
|
{
|
|
config,
|
|
lib,
|
|
pkgs,
|
|
...
|
|
}:
|
|
let
|
|
home = config.home.homeDirectory;
|
|
zkConfig = ''
|
|
[note]
|
|
filename = "{{format-date now 'timestamp'}}-{{slug title}}"
|
|
template = "default.md"
|
|
|
|
[tool]
|
|
fzf-preview = "bat --plain --color=always {-1}"
|
|
'';
|
|
noteTemplate = ''
|
|
---
|
|
date: {{format-date now}}
|
|
---
|
|
|
|
# {{title}}
|
|
'';
|
|
in
|
|
{
|
|
home.packages = with pkgs; [
|
|
ripgrep-all
|
|
zk
|
|
];
|
|
|
|
home.file = {
|
|
"sync/notes/.zk/config.toml".text = zkConfig;
|
|
"sync/notes/.zk/templates/default.md".text = noteTemplate;
|
|
"sync/work/notes/.zk/config.toml".text = zkConfig;
|
|
"sync/work/notes/.zk/templates/default.md".text = noteTemplate;
|
|
};
|
|
|
|
home.activation.createNotesLayout = lib.hm.dag.entryAfter [ "writeBoundary" ] ''
|
|
${pkgs.coreutils}/bin/mkdir -p \
|
|
"${home}/sync/notes/transcripts" \
|
|
"${home}/sync/recordings/inbox" \
|
|
"${home}/sync/recordings/processing" \
|
|
"${home}/sync/recordings/archive" \
|
|
"${home}/sync/recordings/failed" \
|
|
"${home}/sync/work/notes/meetings" \
|
|
"${home}/sync/work/notes/transcripts" \
|
|
"${home}/sync/work/recordings/inbox" \
|
|
"${home}/sync/work/recordings/processing" \
|
|
"${home}/sync/work/recordings/archive" \
|
|
"${home}/sync/work/recordings/failed"
|
|
'';
|
|
|
|
programs.helix.languages = {
|
|
language-server.zk = {
|
|
command = lib.getExe pkgs.zk;
|
|
args = [ "lsp" ];
|
|
};
|
|
|
|
language = [
|
|
{
|
|
name = "markdown";
|
|
roots = [ ".zk" ];
|
|
language-servers = [ "zk" ];
|
|
}
|
|
];
|
|
};
|
|
};
|
|
|
|
flake.modules.nixos.notes =
|
|
{ ... }:
|
|
{
|
|
home-manager.sharedModules = [ homeModules.notes ];
|
|
};
|
|
}
|