{"action":"created","issue":{"url":"https://api.github.com/repos/NixOS/nixpkgs/issues/21420","repository_url":"https://api.github.com/repos/NixOS/nixpkgs","labels_url":"https://api.github.com/repos/NixOS/nixpkgs/issues/21420/labels{/name}","comments_url":"https://api.github.com/repos/NixOS/nixpkgs/issues/21420/comments","events_url":"https://api.github.com/repos/NixOS/nixpkgs/issues/21420/events","html_url":"https://github.com/NixOS/nixpkgs/issues/21420","id":197524088,"number":21420,"title":"gphoto2: insufficient permissions (includes workaround)","user":{"login":"league","id":50286,"avatar_url":"https://avatars.githubusercontent.com/u/50286?v=3","gravatar_id":"","url":"https://api.github.com/users/league","html_url":"https://github.com/league","followers_url":"https://api.github.com/users/league/followers","following_url":"https://api.github.com/users/league/following{/other_user}","gists_url":"https://api.github.com/users/league/gists{/gist_id}","starred_url":"https://api.github.com/users/league/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/league/subscriptions","organizations_url":"https://api.github.com/users/league/orgs","repos_url":"https://api.github.com/users/league/repos","events_url":"https://api.github.com/users/league/events{/privacy}","received_events_url":"https://api.github.com/users/league/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-12-26T02:08:40Z","updated_at":"2016-12-26T09:00:28Z","closed_at":null,"body":"## Issue description\r\n\r\nI could not access my USB digital camera as a non-root user, due to insufficient permissions. The file in `/dev/bus/usb` popped up with user and group set to `root`.\r\n\r\nI'm new to NixOS and I'm not sure of the best way to solve something like this. Below I'll document a workaround that I used in my `configuration.nix` that solved the problem, in case that's helpful to others. But if a NixOS option along with some facility in the `gphoto2` package could solve it, that would be ideal.\r\n\r\n### Steps to reproduce\r\n\r\n  - Plug camera into USB\r\n  - Ensure it shows up in `lsusb`\r\n  - Run `gphoto2 -L`\r\n  - At first it died with \"unknown error\", but if you do `gphoto2 --debug -L` you see the \"insufficient permissions\" message.\r\n\r\n## Technical details\r\n\r\n* System: 16.09.1357.9625cae (Flounder)\r\n* Nix version: nix-env (Nix) 1.11.4\r\n* Nixpkgs version: 16.09.1357.9625cae\r\n\r\n## Workaround\r\n\r\nI added these to my `configuration.nix`:\r\n\r\n```\r\nlet\r\n  gphoto2-udev-rules = pkgs.stdenv.mkDerivation {\r\n    name = \"gphoto2-udev-rules\";\r\n    phases = [\"installPhase\"];\r\n    src = ./40-gphoto.rules;\r\n    installPhase = ''\r\n      mkdir -p $out/etc/udev/rules.d\r\n      stripHash $src\r\n      cp $src $out/etc/udev/rules.d/$strippedName\r\n    '';\r\n  };\r\nin\r\n{  # ... other settings ...\r\n\r\n  users.extraGroups.camera.members = [\"league\"];  #  My user name\r\n  services.udev.packages = [gphoto2-udev-rules];\r\n}\r\n```\r\n\r\nwhere I copied the `40-gphoto.rules` file [from the ArchLinux distribution](https://www.archlinux.org/packages/extra/x86_64/libgphoto2/).\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/NixOS/nixpkgs/issues/comments/269187076","html_url":"https://github.com/NixOS/nixpkgs/issues/21420#issuecomment-269187076","issue_url":"https://api.github.com/repos/NixOS/nixpkgs/issues/21420","id":269187076,"user":{"login":"Mic92","id":96200,"avatar_url":"https://avatars.githubusercontent.com/u/96200?v=3","gravatar_id":"","url":"https://api.github.com/users/Mic92","html_url":"https://github.com/Mic92","followers_url":"https://api.github.com/users/Mic92/followers","following_url":"https://api.github.com/users/Mic92/following{/other_user}","gists_url":"https://api.github.com/users/Mic92/gists{/gist_id}","starred_url":"https://api.github.com/users/Mic92/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Mic92/subscriptions","organizations_url":"https://api.github.com/users/Mic92/orgs","repos_url":"https://api.github.com/users/Mic92/repos","events_url":"https://api.github.com/users/Mic92/events{/privacy}","received_events_url":"https://api.github.com/users/Mic92/received_events","type":"User","site_admin":false},"created_at":"2016-12-26T09:00:28Z","updated_at":"2016-12-26T09:00:28Z","body":"@league you can graft a `programs` module, which does exactly this to fix this in long term."}}
{"actor":{"display_login":"Mic92"}}