Fallout 4 weapon mods

Overview
Weapon mods can be built from raw materials and attached to weapons at weapons workbenches. There are over 700 mods, including scopes, barrels, stocks, and more. For guns the Gun Nut perk is required, while Science! is required to modify energy weapons, and Blacksmith is required for most melee weapons mods.

Perks and Weapon Mods
Most pistols and rifles offer option to customize Grip/Stock, Receiver and Sights, changing which perks affect the weapon:
 * A Pistol or Rifle with an Automatic Receiver gets bonus from Commando perk.
 * Pistols with non-automatic Receivers get bonus from Gunslinger perk.
 * Rifles with non-automatic Receivers get bonus from Rifleman perk.
 * Sniper perk only works on non-automatic Rifles with scopes which use Hold Breath mechanic

Grip mods create Pistol weapons, while Stock mods create Rifle weapons. This allows for almost any ranged weapon to be customized to fit your character's build.