Although this question is a tad old, I'd thought I'd share my solution since none of the other answers addressed how to have this work on boot.
My situation:
I have a Happy Hacking Keyboard that plugs in via usb that has keys moved around (control where caps lock is, etc). I use this most of the time, but sometimes I would like to use the standard laptop keyboard or another usb keyboard. For these keyboards I created a custom keyboard layout.
The trick is that the custom keyboard layout should not be applied to the Happy Hacking Keyboard.
Solution:
I created a Xorg config file as such:
$ cat /etc/X11/xorg.conf.d/30-keyboard.conf
Section "InputClass"
Identifier "Happily Hacked Keyboard"
MatchDevicePath "/dev/input/event*"
MatchIsKeyboard "on"
Driver "evdev"
Option "XkbLayout" "us"
Option "XkbVariant" "hhk"
EndSection
Section "InputClass"
Identifier "Happy Hacking Keyboard"
MatchIsKeyboard "on"
MatchVendor "Topre_Corporation"
Driver "evdev"
Option "XkbLayout" "us"
Option "XkbVariant" "basic"
EndSection
The first part basically says for any standard keyboard, apply the us layout with the the custom variant. The second part says for the happy hacking keyboard, use the us layout with the basic variant.
You can match devices based on a bunch of parameters: xorg doc