anchor.diff:      output ${name}
       ${optionalString (config.position != "") "pos ${config.position}"}
       ${optionalString config.primary "primary"}
  +    ${optionalString (config.dpi != null) "dpi ${toString config.dpi}"}
       ${optionalString (config.gamma != "") "gamma ${config.gamma}"}
       ${optionalString (config.mode != "") "mode ${config.mode}"}
       ${optionalString (config.rate != "") "rate ${config.rate}"}
       ${optionalString (config.rotate != null) "rotate ${config.rotate}"}
  +    ${optionalString (config.scale != null) (
  +      (if config.scale.method == "factor" then "scale" else "scale-from")
  +      + " ${toString config.scale.x}x${toString config.scale.y}"
  +    )}
       ${optionalString (config.transform != null) (
         "transform " + concatMapStringsSep "," toString (flatten config.transform)
       )}
  
positive.code:             <manvolnum>1</manvolnum>
            </citerefentry>
            for the documentation of the transform matrix.
          '';
        };
      };
  
negative.code:   };
  
    config = mkIf cfg.enable {
      assertions = flatten (mapAttrsToList (
        profile: { config, ... }: mapAttrsToList (
          output: opts: {
            assertion = opts.scale == null || opts.transform == null;
            message = ''
              Cannot use the profile output options 'scale' and 'transform' simultaneously.
              Check configuration for: programs.autorandr.profiles.${profile}.config.${output}
            '';
          })
          config
      )
      cfg.profiles);
  
      home.packages = [ pkgs.autorandr ];
      xdg.configFile = mkMerge ([
        (mapAttrs' (hookToFile "postswitch.d") cfg.hooks.postswitch)
  