diff --git a/home/nvim/default.nix b/home/nvim/default.nix index c1ca072..e2c8566 100644 --- a/home/nvim/default.nix +++ b/home/nvim/default.nix @@ -1,6 +1,7 @@ { config, pkgs, ... }: { + imports = [ ./khard-dump.nix ]; home.packages = with pkgs; [ nodePackages.typescript-language-server marksman @@ -17,7 +18,7 @@ src = builtins.fetchGit { url = "ssh://git@shorbut.ktiu.net/home/git/woof.vim/"; ref = "main"; - rev = "146eca695d0c3901905f4d46d9defd1f624dc193"; + rev = "5c3f6675436e33e56e2f43ed8853925daaf1d011"; }; }; in diff --git a/home/nvim/khard-dump.nix b/home/nvim/khard-dump.nix new file mode 100644 index 0000000..cc13376 --- /dev/null +++ b/home/nvim/khard-dump.nix @@ -0,0 +1,29 @@ +{ config, pkgs, ... }: + +{ + systemd.user.timers = { + khard-dump = { + Unit = { + Description = "Timer to run khard-dump service"; + }; + Timer = { + OnCalendar = "*:00/10"; + Unit = "khard-dump.service"; + }; + }; + }; + + systemd.user.services = { + khard-dump = { + Unit = { + Description = "Dumps contact info to custom cache file"; + }; + Service = { + ExecStart = "${pkgs.writeScript "khard-dump" '' + #! ${pkgs.stdenv.shell} + ${pkgs.khard.outPath}/bin/khard email --parsable --remove-first-line | awk 'BEGIN{FS=OFS="\t"}{print $2, $1}\' > ${config.xdg.cacheHome}/khard-dump + ''}"; + }; + }; + }; +}