ooknet/modules/home/workstation/productivity/obsidian.nix
2025-01-28 19:56:06 +11:00

30 lines
704 B
Nix

{
lib,
config,
osConfig,
pkgs,
...
}: let
inherit (lib) mkIf elem hm;
inherit (osConfig.ooknet.workstation) profiles;
# admin = osConfig.ooknet.host.admin;
# TODO: use admin.githubUsername
notesRepo = "git@github.com:ooks-io/notes.git";
notesPath = "${config.xdg.userDirs.extraConfig.XDG_NOTES_DIR}";
in {
config = mkIf (elem "productivity" profiles) {
home.packages = [pkgs.obsidian];
home.activation.cloneObsidianVault =
hm.dag.entryAfter ["installPackages"]
/*
shell
*/
''
if ! [ -d "${notesPath}" ]; then
$DRY_RUN_CMD git clone ${notesRepo} ${notesPath}
fi
'';
ooknet.binds.notes = "obsidian";
};
}