anchor.diff:      };
   
       shadowOpacity = mkOption {
  -      type = floatBetween "0.0" "1.01";
  -      default = "0.75";
  -      example = "0.8";
  -      description = ''
  -        Window shadows opacity (number in range 0.0 - 1.0).
  +      type = floatBetween 0 1;
  +      default = 0.75;
  +      example = 0.8;
  +      description = ''
  +        Window shadows opacity.
         '';
       };
   
  
positive.code:     };
  
      refreshRate = mkOption {
        type = types.addCheck types.int (x: x >= 0);
        default = 0;
        example = 60;
        description = ''
  
negative.code: { config, lib, pkgs, ... }:
  
  with lib;
  
  let
  
    cfg = config.services.picom;
  
    pairOf = x: with types;
      addCheck (listOf x) (y: length y == 2)
      // { description = "pair of ${x.description}"; };
  
    floatBetween = a: b: with types;
      let
        # toString prints floats with hardcoded high precision
        floatToString = f: builtins.toJSON f;
      in
        addCheck float (x: x <= b && x >= a)
        // { description = "a floating point number in " +
                           "range [${floatToString a}, ${floatToString b}]"; };
  
    mkDefaultAttrs = mapAttrs (n: v: mkDefault v);
  
    # Basically a tinkered lib.generators.mkKeyValueDefault
    # It either serializes a top-level definition "key: { values };"
    # or an expression "key = { values };"
    mkAttrsString = top:
      mapAttrsToList (k: v:
        let sep = if (top && isAttrs v) then ":" else "=";
        in "${escape [ sep ] k}${sep}${mkValueString v};");
  
    # This serializes a Nix expression to the libconfig format.
    mkValueString = v:
           if types.bool.check  v then boolToString v
      else if types.int.check   v then toString v
      else if types.float.check v then toString v
      else if types.str.check   v then "\"${escape [ "\"" ] v}\""
      else if builtins.isList   v then "[ ${concatMapStringsSep " , " mkValueString v} ]"
      else if types.attrs.check v then "{ ${concatStringsSep " " (mkAttrsString false v) } }"
      else throw ''
                   invalid expression used in option services.picom.settings:
                   ${v}
                 '';
  
    toConf = attrs: concatStringsSep "\n" (mkAttrsString true cfg.settings);
  
    configFile = pkgs.writeText "picom.conf" (toConf cfg.settings);
  
  