I recently started tinkering with my Arduino again. To upload my first sketch I used the Arduino-CLI:
arduino-cli upload -p /dev/ttyACM0 --fqbn arduino:avr:uno <MySketchName>
Unfortunately, this caused a Permission Denied Error.
The Fix
To use the serial port, a user has to be a member of the dialout group. The fix on most Linux distributions is to add the user to the group via:
sudo usermod -a -G dialout <username>
On NixOS
As a NixOS however, I had to adjust my configuration:
users.users.fbull = {
isNormalUser = true;
description = "fbull";
extraGroups = [ "networkmanager" "wheel" "video" "docker" "audio" "dialout" ];
shell = pkgs.zsh;
};