nix-config/pkgs/dav-sync/default.nix

22 lines
520 B
Nix
Raw Permalink Normal View History

2023-08-13 20:13:46 +02:00
{ pkgs, ... }:
let
addressbook = "$HOME/.abook/addressbook";
contacts = "$HOME/Contacts";
in
pkgs.writeShellApplication {
name = "dav-sync";
runtimeInputs = [ "vdirsyncer" "coreutils" "abook" ];
text = ''
vdirsyncer discover && \
vdirsyncer sync && \
mkdir -p "$(dirname "${addressbook}")" && \
cat "${contacts}"/*/*/* | \
abook \
--convert \
--informat vcard \
--outformat abook > \
"${addressbook}"
'';
}