Compare commits

..

2 Commits

Author SHA1 Message Date
Sam c5da58fc3b Add vimwiki-sync plugin to nixvim 2024-07-19 11:27:05 +01:00
Sam 82b0838f5c Add get-notes in home-manager activation script 2024-07-19 11:26:32 +01:00
3 changed files with 43 additions and 1 deletions

View File

@ -1,4 +1,7 @@
{ pkgs, ... }: { pkgs, config, ... }:
let
user = config.home.username;
in
{ {
imports = [ imports = [
./cmp.nix ./cmp.nix
@ -38,6 +41,16 @@
}; };
}) })
(pkgs.vimUtils.buildVimPlugin
{
name = "vimwiki-sync";
src = pkgs.fetchFromGitHub {
owner = "michal-h21";
repo = "vimwiki-sync";
rev = "99eeab3";
sha256 = "sha256-cz0dSFphIbQAI4AOqwIUpDBTuj/3xlOkhSlIVMdgsqM=";
};
})
# Keep vim-devicons as last entry # Keep vim-devicons as last entry
pkgs.vimPlugins.vim-devicons pkgs.vimPlugins.vim-devicons
@ -85,6 +98,16 @@
opts opts
) )
end end
-- Setup vimwiki
vim.g.vimwiki_list = {
{
syntax = "markdown",
ext = ".md",
path = "/home/${user}/.local/share/notes",
},
}
''; '';
} }

View File

@ -4,6 +4,7 @@
./alacritty.nix ./alacritty.nix
./zotero.nix ./zotero.nix
./fontconfig.nix ./fontconfig.nix
./notes.nix
]; ];
# Global packages for desktop environments # Global packages for desktop environments

View File

@ -0,0 +1,18 @@
{ pkgs, config, lib, ... }:
let
user = config.home.username;
in
{
home.activation.get-notes = lib.hm.dag.entryAfter [ "installPackages" ] ''
notes_dir=/home/${user}/.local/share/notes
remote=git@git.bitlab21.com:sam/notes
if [ -d "$notes_dir" ];
then
cd "$notes_dir"
[ ! -d .git ] && PATH="${pkgs.git}/bin:${pkgs.openssh}/bin:$PATH" git clone "$remote" "$notes_dir"
else
mkdir -p "$notes_dir" && PATH="${pkgs.git}/bin:${pkgs.openssh}/bin:$PATH" git clone "$remote" "$notes_dir"
fi
exit 0
'';
}