From 3e9a27874a8110f5e6af2afff3de6efbc5b71e8f Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Sun, 19 Jan 2025 21:49:25 +0000 Subject: [PATCH] Alter notes to create daily notes Alter notes to create daily notes instead of monthly notes. --- nix/pkgs/default.nix | 2 +- nix/pkgs/notes/create-daily-notes.patch | 13 +++++++++++++ nix/pkgs/{notes.nix => notes/default.nix} | 6 +++++- 3 files changed, 19 insertions(+), 2 deletions(-) create mode 100644 nix/pkgs/notes/create-daily-notes.patch rename nix/pkgs/{notes.nix => notes/default.nix} (82%) diff --git a/nix/pkgs/default.nix b/nix/pkgs/default.nix index 84a76b7..48ed2e4 100644 --- a/nix/pkgs/default.nix +++ b/nix/pkgs/default.nix @@ -7,7 +7,7 @@ let in { build-glove80 = callPackage ./build-glove80.nix { }; - notes = callPackage ./notes.nix { }; + notes = callPackage ./notes { }; i3-battery-popup = callPackage ./i3-battery-popup.nix { }; tmux-sessionizer = callPackage ./tmux-sessionizer { }; upload-to-files = callPackage ./upload-to-files.nix { }; diff --git a/nix/pkgs/notes/create-daily-notes.patch b/nix/pkgs/notes/create-daily-notes.patch new file mode 100644 index 0000000..6baea3b --- /dev/null +++ b/nix/pkgs/notes/create-daily-notes.patch @@ -0,0 +1,13 @@ +diff --git a/notes b/notes +index 3351903..34364bf 100755 +--- a/notes ++++ b/notes +@@ -14,7 +14,7 @@ set -e + readonly NOTES_DIRECTORY="${NOTES_DIRECTORY:-${HOME}/notes}" + readonly NOTES_EDITOR="${EDITOR}" + +-readonly NOTES_FILE="$(date +%Y-%m).txt" ++readonly NOTES_FILE="$(date +%Y-%m-%d).txt" + readonly NOTES_PATH="${NOTES_DIRECTORY}/${NOTES_FILE}" + + if [ ! -d "${NOTES_DIRECTORY}" ]; then diff --git a/nix/pkgs/notes.nix b/nix/pkgs/notes/default.nix similarity index 82% rename from nix/pkgs/notes.nix rename to nix/pkgs/notes/default.nix index 712eb30..d6944e9 100644 --- a/nix/pkgs/notes.nix +++ b/nix/pkgs/notes/default.nix @@ -15,9 +15,13 @@ stdenv.mkDerivation rec { buildInputs = [ bash ]; + patches = [ + ./create-daily-notes.patch + ]; + installPhase = '' mkdir -p $out/bin - cp $src/notes $out/bin/notes + cp notes $out/bin/notes chmod +x $out/bin/notes ''; }