From 452f5875ce3247caed93755fbe798ff4560c8353 Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Mon, 16 Dec 2024 17:58:54 +0000 Subject: [PATCH] Set the notes directory path --- nix/lib/shared/scripts/export-video-list.nix | 2 +- nix/modules/home-manager/default.nix | 4 ++++ nix/modules/home-manager/features/cli/notes.nix | 10 +++++++++- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/nix/lib/shared/scripts/export-video-list.nix b/nix/lib/shared/scripts/export-video-list.nix index f81e04f..257e279 100644 --- a/nix/lib/shared/scripts/export-video-list.nix +++ b/nix/lib/shared/scripts/export-video-list.nix @@ -25,7 +25,7 @@ exit 1 fi - output_file="$HOME/Documents/videos.json" + output_file="''${DOCUMENTS}/videos.json" ${pkgs.tree}/bin/tree -J "$source_path/Videos" | ${pkgs.jq}/bin/jq . > "$output_file" ${pkgs.jq}/bin/jq . < "$output_file" diff --git a/nix/modules/home-manager/default.nix b/nix/modules/home-manager/default.nix index f6fe1b8..6f67cc9 100644 --- a/nix/modules/home-manager/default.nix +++ b/nix/modules/home-manager/default.nix @@ -20,4 +20,8 @@ }) ./features/desktop ]; + + home.sessionVariables = { + DOCUMENTS = "$HOME/Documents"; + }; } diff --git a/nix/modules/home-manager/features/cli/notes.nix b/nix/modules/home-manager/features/cli/notes.nix index 1c64186..b82e240 100644 --- a/nix/modules/home-manager/features/cli/notes.nix +++ b/nix/modules/home-manager/features/cli/notes.nix @@ -1,5 +1,13 @@ { pkgs, ... }: { - home.packages = with pkgs; [ notes ]; + home = { + packages = with pkgs; [ notes ]; + + sessionVariables = { + NOTES_DIRECTORY = "$WIKI_DIRECTORY/notes"; + WIKI_DIRECTORY = "$DOCUMENTS/wiki"; + }; + }; + }