{ pkgs, ... }: { home.packages = with pkgs; [ restic ]; systemd.user.services.backup = { Unit = { Description = "backup my home directory"; Documentation = "man:resitc(1)"; }; Service = { Type = "oneshot"; Environment = [ "RESTIC_REPOSITORY=rest:http://192.168.6.10:8010/" "RESTIC_PASSWORD_COMMAND=\"pass backup/restic@%H\"" ]; ExecStartPre = "${pkgs.systemd}/lib/systemd/systemd-networkd-wait-online --interface=wg0"; ExecStart = "${pkgs.restic}/bin/restic --tag=home-nixos --exclude=%h/media --exclude=%C --exclude=%E backup %h"; }; }; }