Paste number 356767: extending udev rules

Paste number 356767: extending udev rules
Pasted by: Apteryx
When:4 years, 2 months ago
Share:Tweet this! |
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
		     networking		;for wicd-service-type
		     ssh)		;for lsh-service

(use-package-modules admin		;for wpa-supplicant

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

  (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"))

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

  ;; 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

  ;; Use the "desktop" services, which include the X11
  ;; log-in service and more.
    ;;(service wpa-supplicant-service-type wpa-supplicant)
    ;; #: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 =>
                          (inherit config)
                           (cons* ""
      ;; Enable using adb as a simple user with some specific devices.
       config =>
	(inherit config)
	(rules (cons*
		 ;; 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.