Add zet-new script
All checks were successful
/ check (push) Successful in 1m40s

This commit is contained in:
Oliver Davies 2025-07-15 12:00:00 +01:00
parent 722a5814fa
commit 2870a256da
4 changed files with 24 additions and 0 deletions

21
packages/zet-new.nix Normal file
View file

@ -0,0 +1,21 @@
{ pkgs }:
pkgs.writeShellApplication {
name = "zet-new";
runtimeInputs = with pkgs; [
coreutils
];
text = ''
folder="''${ZET_DIR:-"$XDG_DOCUMENTS_DIR/wiki/zet"}"
mkdir -p "$folder"
note="$folder/$(date +%Y-%m-%d-%T | sed 's/[-:]//g').md"
printf "# %s\n\n\n" "$1" > "$note"
"$EDITOR" "+normal G" "$note"
'';
}