anchor.diff: -{ config, lib, pkgs, ...}:
  +{ config, lib, pkgs, ... }:
   
   with lib;
  -
   let
     cfg = config.services.duplicity;
   
     stateDirectory = "/var/lib/duplicity";
   
  -  localTarget = if hasPrefix "file://" cfg.targetUrl
  +  localTarget =
  +    if hasPrefix "file://" cfg.targetUrl
       then removePrefix "file://" cfg.targetUrl else null;
   
  -in {
  +in
  +{
     options.services.duplicity = {
       enable = mkEnableOption "backups with duplicity";
   
  
positive.code: 
      include = mkOption {
        type = types.listOf types.str;
        default = [];
        example = [ "/home" ];
        description = ''
          List of paths to include into the backups. See the FILE SELECTION
  
negative.code: 
          serviceConfig = {
            ExecStart = ''
                          ${pkgs.duplicity}/bin/duplicity ${escapeShellArgs (
                            [
                              cfg.root
                              cfg.targetUrl
                              "--archive-dir"
              stateDirectory
                            ]
                            ++ concatMap (p: [ "--include" p ]) cfg.include
                            ++ concatMap (p: [ "--exclude" p ]) cfg.exclude
                            ++ cfg.extraFlags
              )}
            '';
            PrivateTmp = true;
            ProtectSystem = "strict";
  