Make NOTES_DIRECTORY configurable per host

This commit is contained in:
Oliver Davies 2025-01-29 01:49:03 +00:00
parent 4f91d5ce7d
commit 02890fc725
5 changed files with 41 additions and 10 deletions

View file

@ -2,6 +2,13 @@
features = {
cli = {
direnv.enable = true;
notes = {
enable = true;
directory = "$HOME/Documents/wiki/tfw-notes";
};
syncthing.enable = true;
tmux-sessionizer.enable = true;
};

View file

@ -4,6 +4,13 @@
features = {
cli = {
direnv.enable = true;
notes = {
enable = true;
directory = "$HOME/Documents/wiki/notes";
};
syncthing.enable = true;
tmux-sessionizer.enable = true;
};

View file

@ -19,8 +19,6 @@
;
})
(import ./notes.nix { inherit pkgs; })
(import ./tmux-sessionizer.nix {
inherit
config
@ -34,6 +32,7 @@
./direnv.nix
./fzf.nix
./git.nix
./notes.nix
./phpactor.nix
./ripgrep.nix
./starship.nix

View file

@ -1,12 +1,31 @@
{ pkgs, ... }:
{
home = {
packages = with pkgs; [ notes ];
config,
lib,
pkgs,
...
}:
sessionVariables = {
NOTES_DIRECTORY = "$DOCUMENTS/wiki/notes";
WIKI_DIRECTORY = "$DOCUMENTS/wiki";
with lib;
let
cfg = config.features.cli.notes;
in
{
options.features.cli.notes = {
enable = mkEnableOption "Enable notes";
directory = mkOption {
type = types.str;
};
};
config = mkIf cfg.enable {
home = {
packages = with pkgs; [ notes ];
sessionVariables = {
NOTES_DIRECTORY = "${cfg.directory}";
};
};
};

View file

@ -3,5 +3,4 @@ Add create-podcast-tasks script
Replace doppler with agenix
Evaluate services.languagetool as a replacement for Grammarly
Make git email address configurable
Make NOTES_DIRECTORY configurable
Finish configuring syncthing with nix - https://github.com/neeasade/dotfiles/blob/694c2a11107c10947af956befe16cbe5cee0abda/os/nixos/config/shared.nix#L62