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

22 lines
520 B
Nix

{ 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}"
'';
}