From d04df63be4367eaf3eb64d72daf10b6f65de2418 Mon Sep 17 00:00:00 2001 From: Daniel Langbein Date: Mon, 9 Sep 2024 14:59:13 +0200 Subject: [PATCH] usb mtp and ptp --- hosts/yodaTab/configuration.nix | 1 + hosts/yodaTux/configuration.nix | 1 + modules/usb-mtp-ptp.nix | 21 +++++++++++++++++++++ 3 files changed, 23 insertions(+) create mode 100644 modules/usb-mtp-ptp.nix diff --git a/hosts/yodaTab/configuration.nix b/hosts/yodaTab/configuration.nix index 56238d0..3087163 100644 --- a/hosts/yodaTab/configuration.nix +++ b/hosts/yodaTab/configuration.nix @@ -10,6 +10,7 @@ ../../modules/base-efi.nix ../../modules/xdg.nix ../../modules/power-management.nix + ../../modules/usb-mtp-ptp.nix ../../modules/ntfs.nix ../../modules/git.nix ../../modules/zsh.nix diff --git a/hosts/yodaTux/configuration.nix b/hosts/yodaTux/configuration.nix index 5ce8927..a5573c2 100644 --- a/hosts/yodaTux/configuration.nix +++ b/hosts/yodaTux/configuration.nix @@ -11,6 +11,7 @@ ../../modules/base-efi.nix ../../modules/xdg.nix ../../modules/power-management.nix + ../../modules/usb-mtp-ptp.nix ../../modules/tuxedo-rs.nix ../../modules/ntfs.nix ../../modules/git.nix diff --git a/modules/usb-mtp-ptp.nix b/modules/usb-mtp-ptp.nix new file mode 100644 index 0000000..b981767 --- /dev/null +++ b/modules/usb-mtp-ptp.nix @@ -0,0 +1,21 @@ +{ config, pkgs, ... }: +{ + # USB MTP and PTP support + # https://wiki.archlinux.org/title/Media_Transfer_Protocol#File_manager_integration + + # Mount USB MTP devices + services.gvfs.enable = true; + + # Manage USB PTP devices (digital cameras) + programs.gphoto2.enable = true; + # To grant digital camera access to a user, + # the user must be part of the camera group: + users.users."yoda".extraGroups = ["camera"]; + # + # Example usage: + # + # gphoto2 --auto-detect + #=> Fuji Fujifilm X-T1 usb:001,002 + # gphoto2 --list-files + # gphoto2 --get-all-files +}