Make notes directory configurable

This commit is contained in:
Oliver Davies 2025-05-06 12:00:00 +01:00
parent 8f591e4da2
commit 5517fd3074
2 changed files with 16 additions and 3 deletions

View file

@ -15,7 +15,13 @@
}; };
node.enable = true; node.enable = true;
notes.enable = true;
notes = {
enable = true;
directory = "${config.xdg.userDirs.documents}/wiki/notes";
};
ranger.enable = true; ranger.enable = true;
starship.enable = true; starship.enable = true;
tmux.enable = true; tmux.enable = true;

View file

@ -11,7 +11,14 @@ let
cfg = config.cli.notes; cfg = config.cli.notes;
in in
{ {
options.cli.notes.enable = mkEnableOption "Enable notes"; options.cli.notes = {
enable = mkEnableOption "Enable notes";
directory = mkOption {
default = "${config.xdg.userDirs.documents}/notes";
type = types.str;
};
};
config = mkIf cfg.enable { config = mkIf cfg.enable {
xdg = { xdg = {
@ -23,7 +30,7 @@ in
packages = with pkgs; [ notes ]; packages = with pkgs; [ notes ];
sessionVariables = { sessionVariables = {
NOTES_DIRECTORY = "${config.xdg.userDirs.documents}/wiki/notes"; NOTES_DIRECTORY = cfg.directory;
}; };
}; };
}; };