Paste number 356767: extending udev rules

Paste number 356767: extending udev rules
Pasted by: Apteryx
When:4 years, 2 months ago
Share:Tweet this! | http://paste.lisp.org/+7NA7
Channel:None
Paste contents:
Raw Source | XML | Display As
;; This is an operating system configuration template
;; for a "desktop" setup without full-blown desktop
;; environments.

(use-modules (gnu)
	     (gnu system nss)
	     (gnu services)
	     (gnu system shadow)	;for user-group
	     (guix store)           ;for %default-substitute-urls
	     (srfi srfi-1))		;for the remove function	    

(use-service-modules base		;for nscd-service-type
		     desktop
		     networking		;for wicd-service-type
		     ssh)		;for lsh-service

(use-package-modules admin		;for wpa-supplicant
		     ratpoison
		     certs)

;; (define %my-desktop-services
;;   ;; Remove the wicd service from %desktop-services.
;;   (remove (lambda (service)
;; 	    (eq? (service-kind service) wicd-service-type))
;; 	  %desktop-services))

(operating-system
  (host-name "apteryx")
  (timezone "America/Montreal")	      ;America/Los_Angeles, Asia/Tokyo
  (locale "en_US.UTF-8")

  ;; Assuming /dev/sdX is the target hard disk, and "my-root"
  ;; is the label of the target root file system.
  (bootloader (bootloader-configuration
	       (bootloader grub-bootloader)
	       (target "/dev/sda")))

  (file-systems (cons (file-system
                        (device "my-root")
                        (title 'label)
                        (mount-point "/")
                        (type "ext4"))
                      %base-file-systems))

  (users (cons (user-account
                (name "maxim")
                (comment "Maxim Cournoyer")
                (group "users")
                (supplementary-groups
		 '("lp"		      ;for bluetooth
		   "plugdev"		;for adb
		   "wheel" "netdev" "audio" "video"))
                (home-directory "/home/maxim"))
               %base-user-accounts))

  ;; Add plugdev to %base-groups
  (groups (cons (user-group (system? #t) (name "plugdev")) %base-groups))
  
  ;; Add a bunch of window managers; we can choose one at
  ;; the log-in screen with F1.
  (packages (cons* ratpoison
                   nss-certs		;for HTTPS access
                   %base-packages))

  ;; Use the "desktop" services, which include the X11
  ;; log-in service and more.
  (services
   (cons*
    ;;(service wpa-supplicant-service-type wpa-supplicant)
    ;;(dhcp-client-service)
    ;; #:config (dhcp-client-configuration
    ;; 	       (ip-version 4))) ;;(interfaces '("poulet"))
    ;;(lsh-service #:x11-forwarding? #f)
    (bluetooth-service #:auto-enable? #t)
    
    (modify-services %desktop-services
      ;; Add a couple extra substitute servers.
      (guix-service-type config =>
                         (guix-configuration
                          (inherit config)
                          (substitute-urls
                           (cons* "https://bayfront.guixsd.org"
				  "https://berlin.guixsd.org"
                                  %default-substitute-urls))))
      ;; Enable using adb as a simple user with some specific devices.
      (udev-service-type
       config =>
       (udev-configuration
	(inherit config)
	(rules (cons*
		(udev-rule
		 "51-android.rules"
		 ;; Add HTC,  phones.
		 (string-append "SUBSYSTEM==\"usb\", ATTR{idVendor}==\"0bb4\","
				"MODE=\"0660\", GROUP=\"plugdev\"\n"))
		(udev-configuration-rules config))))))))

  ;; Allow resolution of '.local' host names with mDNS.
  (name-service-switch %mdns-host-lookup-nss))

This paste has no annotations.

Colorize as:
Show Line Numbers

Lisppaste pastes can be made by anyone at any time. Imagine a fearsomely comprehensive disclaimer of liability. Now fear, comprehensively.