diff --git a/pathauto.variable.inc b/pathauto.variable.inc
new file mode 100644
index 0000000..cd34fb7
--- /dev/null
+++ b/pathauto.variable.inc
@@ -0,0 +1,70 @@
+<?php
+
+/**
+ * @file pathauto.variable.inc
+ * Contains definition of variables for Variable API module.
+ */
+
+/**
+ * Implements hook_variable_info().
+ */
+function pathauto_variable_info($options) {
+  $variables = array();
+
+  // Call the hook on all modules - an array of 'settings' objects is returned.
+  $all_settings = module_invoke_all('pathauto', 'settings');
+  foreach ($all_settings as $settings) {
+    $module = $settings->module;
+    $patterndescr = $settings->patterndescr;
+    $patterndefault = $settings->patterndefault;
+    $groupheader = $settings->groupheader;
+
+    // Default pattern for this module.
+    $variable = 'pathauto_' . $module . '_pattern';
+    $variables[$variable] = array(
+      'type' => 'string',
+      'group' => 'pathauto',
+      'title' => $patterndescr,
+      'description' => t('Default path alias pattern for the @module module.', array(
+        '@module' => $settings->module,
+      ), $options),
+      'default' => $patterndefault,
+      'validate callback' => 'token_element_validate',
+      // Support for Variable Realm module. Pathauto already handles its pattern
+      // variables per-language, so we only need the domain realm
+      'multidomain' => TRUE,
+    );
+
+    // If the module supports a set of specialized patterns, define them.
+    if (isset($settings->patternitems)) {
+      foreach ($settings->patternitems as $itemname => $itemlabel) {
+        $variable = 'pathauto_' . $module . '_' . $itemname . '_pattern';
+        $variables[$variable] = array(
+          'type' => 'string',
+          'group' => 'pathauto',
+          'title' => $itemlabel,
+          'description' => t('Specialized path alias pattern for the @module module.', array(
+            '@module' => $settings->module,
+          ), $options),
+          'validate callback' => 'token_element_validate',
+          'multidomain' => TRUE,
+        );
+      }
+    }
+  }
+
+  return $variables;
+}
+
+/**
+ * Implements hook_variable_group_info().
+ */
+function pathauto_variable_group_info() {
+  $groups['pathauto'] = array(
+    'title' => t('Pathauto'),
+    'description' => t('Path alias patterns'),
+    'access' => 'administer pathauto',
+    'path' => array('admin/config/search/path/patterns'),
+  );
+  return $groups;
+}
