add zk
Signed-off-by: gwg313 <gwg313@pm.me>
This commit is contained in:
parent
b5592c1e05
commit
b4d8460621
2 changed files with 108 additions and 0 deletions
|
|
@ -56,6 +56,7 @@
|
|||
"earlyoom"
|
||||
"dolphin"
|
||||
"pass"
|
||||
"zk"
|
||||
];
|
||||
|
||||
laptop.features = [
|
||||
|
|
|
|||
107
modules/features/desktop/zk.nix
Normal file
107
modules/features/desktop/zk.nix
Normal file
|
|
@ -0,0 +1,107 @@
|
|||
{ ... }:
|
||||
{
|
||||
config.dendritic.features.zk.homeModules = [
|
||||
(
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
|
||||
home.sessionVariables = {
|
||||
ZK_NOTEBOOK_DIR = "/home/gwg313/my-notes";
|
||||
};
|
||||
programs.zk = {
|
||||
enable = true;
|
||||
settings = {
|
||||
notebook = {
|
||||
dir = "~/my-notes";
|
||||
};
|
||||
note = {
|
||||
language = "en";
|
||||
default-title = "Untitled";
|
||||
filename = "{{id}}-{{slug title}}";
|
||||
extension = "md";
|
||||
template = "inbox.md";
|
||||
id-charset = "alphanum";
|
||||
id-length = 4;
|
||||
id-case = "lower";
|
||||
};
|
||||
format.markdown = {
|
||||
multiword-tags = true;
|
||||
hashtags = true;
|
||||
};
|
||||
|
||||
tool = {
|
||||
editor = "nvim";
|
||||
fzf-preview = "bat -p --color always {-1}";
|
||||
};
|
||||
|
||||
extra = {
|
||||
author = "gwg313";
|
||||
};
|
||||
group = {
|
||||
inbox = {
|
||||
paths = [ "inbox" ];
|
||||
note.template = "inbox.md";
|
||||
};
|
||||
projects = {
|
||||
paths = [ "projects" ];
|
||||
note.template = "project.md";
|
||||
};
|
||||
literature = {
|
||||
paths = [ "literature" ];
|
||||
note.template = "literature.md";
|
||||
};
|
||||
note = {
|
||||
paths = [ "notes" ];
|
||||
note.template = "permanent.md";
|
||||
};
|
||||
|
||||
seed = {
|
||||
paths = [ "notes" ];
|
||||
note.template = "seed.md";
|
||||
};
|
||||
|
||||
daily = {
|
||||
paths = [ "journal" ];
|
||||
note.filename = "{{format-date now}}";
|
||||
note.template = "daily.md";
|
||||
};
|
||||
};
|
||||
filter = {
|
||||
# Notes created in last 2 weeks
|
||||
recents = "--sort created- --created-after 'last two weeks'";
|
||||
|
||||
# Only permanent notes
|
||||
permanent = "--group notes";
|
||||
|
||||
# Orphans (useful for cleaning up disconnected notes)
|
||||
orphans = "--orphan";
|
||||
seeds = "--tag seed --sort created-";
|
||||
};
|
||||
alias = {
|
||||
ls = "zk list --interactive $@";
|
||||
edit = "zk edit --interactive $@";
|
||||
inbox = ''zk new --no-input "$ZK_NOTEBOOK_DIR/inbox" --group inbox --title "$@"'';
|
||||
seed = ''zk new --no-input "$ZK_NOTEBOOK_DIR/inbox" --group seed --title "$@"'';
|
||||
proj = ''zk new --no-input "$ZK_NOTEBOOK_DIR/projects/" --group projects --title "$@"'';
|
||||
lit = ''zk new --no-input "$ZK_NOTEBOOK_DIR/literature" --group literature --title "$@"'';
|
||||
note = ''zk new --no-input "$ZK_NOTEBOOK_DIR/notes" --group notes --title "$@"'';
|
||||
# Edit the last modified note.
|
||||
edlast = "zk edit --limit 1 --sort modified- $@";
|
||||
seeds = "zk list seeds --interactive";
|
||||
# Edit the notes selected interactively among the notes created the last two weeks.
|
||||
recent = "zk edit --sort created- --created-after 'last two weeks' --interactive";
|
||||
|
||||
# Show a random note.
|
||||
lucky = "zk list --quiet --format full --sort random --limit 1";
|
||||
# Show backlinks to a given note
|
||||
bl = "zk list --link-to $@";
|
||||
|
||||
# Orphans
|
||||
orph = "zk list orphans --interactive";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
)
|
||||
];
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue