# Can I permanently add add a method to the driver namespace?

I have a method x which I can add to the driver namespace like this:

bpy.app.driver_namespace["x"] = x


but the namespace is reset everytime I restart Blender, which then messes up my drivers. Is there a way to permanently add it to the namespace or auto-execute this script when starting Blender?

Put this code into a Python file and place it into ~/.config/blender/2.78/scrips/startup/my_driver_stuff.py (replace ~/config/blender with %APPDATA%/Blender Foundation/Blender on Windows, and something along those lines on MacOS).
import bpy