From 25439810cd4a99a2e8eebd4748a027cae5a93745 Mon Sep 17 00:00:00 2001 From: Malte Tammena Date: Fri, 23 Feb 2024 20:38:51 +0100 Subject: [PATCH] feat(user/malte): new note-taking approach --- users/malte/home.nix | 2 +- users/malte/nb.nix | 33 --------------------------------- users/malte/notes.nix | 18 ++++++++++++++++++ 3 files changed, 19 insertions(+), 34 deletions(-) delete mode 100644 users/malte/nb.nix create mode 100644 users/malte/notes.nix diff --git a/users/malte/home.nix b/users/malte/home.nix index f453866..607e9ff 100644 --- a/users/malte/home.nix +++ b/users/malte/home.nix @@ -115,7 +115,7 @@ in { ./mpv.nix ./broot.nix ./hypr.nix - ./nb.nix + ./notes.nix ../modules/restic-backup.nix ../modules/colors.nix ../modules/profiles-cleanup.nix diff --git a/users/malte/nb.nix b/users/malte/nb.nix deleted file mode 100644 index f1192cc..0000000 --- a/users/malte/nb.nix +++ /dev/null @@ -1,33 +0,0 @@ -{ - config, - pkgs, - lib, - ... -}: let - toEnvFile = attrs: lib.strings.concatLines (lib.attrsets.mapAttrsToList (key: value: "${key}=${builtins.toString value}") attrs); -in { - home.packages = [ - pkgs.nb - pkgs.nmap - pkgs.w3m - pkgs.joshuto - pkgs.pandoc - ]; - - home.sessionVariables = { - NBRC_PATH = "${config.xdg.configHome}/nb/nbrc"; - }; - - xdg.configFile."nb/nbrc".text = toEnvFile { - NB_DIR = "${config.xdg.dataHome}/nb"; - NB_ENCRYPTION_TOOL = "gpg"; - # NB_SYNTAX_THEME="gruvbox-dark"; - NB_COLOR_PRIMARY = 3; - NB_COLOR_SECONDARY = 5; - - NB_ACE_ENABLED = "1"; - - NB_IMAGE_TOOL = "${pkgs.timg}/bin/timg"; - NB_MARKDOWN_TOOL = "${pkgs.mdcat}/bin/mdcat"; - }; -} diff --git a/users/malte/notes.nix b/users/malte/notes.nix new file mode 100644 index 0000000..0bdf949 --- /dev/null +++ b/users/malte/notes.nix @@ -0,0 +1,18 @@ +{pkgs, ...}: let + note = pkgs.writeShellApplication { + name = "note"; + runtimeInputs = [ + pkgs.helix + pkgs.coreutils + pkgs.marksman + ]; + text = '' + year=$(date +"%Y") + pushd "$XDG_DATA_HOME/life.md" + hx "$year.md" +99999 + popd + ''; + }; +in { + home.packages = [note]; +}