nix-config/packages/zet-new.nix

22 lines
374 B
Nix
Raw Normal View History

2025-07-15 12:00:00 +01:00
{ pkgs }:
pkgs.writeShellApplication {
name = "zet-new";
runtimeInputs = with pkgs; [
coreutils
];
text = ''
folder="''${ZET_DIR:-"$XDG_DOCUMENTS_DIR/wiki/zet"}/$(date +%Y)/$(date +%m)"
2025-07-15 12:00:00 +01:00
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"
'';
}