To add it to the search bar, go to http://duckduckgo.com/ or https://duckduckgo.com/ (depending on if you want SSL or not), and click 'Add to Firefox' at the bottom.
To add it to the address bar, type about:config into the address bar, search for keyword.url and then change it to http://duckduckgo.com/?q= (or https://duckduckgo.com/?q= for SSL).