awesome.scm 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280
  1. ;; This is my guixSD configuration with the awesome window manager.
  2. (use-modules (gnu)
  3. (gnu system nss)
  4. ;;(gnu services xorg)
  5. (srfi srfi-1))
  6. ;; for read-string
  7. ;;(sxml ssax input-parse))
  8. (use-service-modules
  9. admin
  10. databases
  11. desktop
  12. networking
  13. mcron
  14. monitoring
  15. sddm
  16. sysctl
  17. web
  18. xorg
  19. )
  20. (use-package-modules base certs idutils freedesktop xorg ;; wm for the awesome window manager
  21. )
  22. ;;(define my-keyboard
  23. ;; (call-with-input-file "/etc/config.d/01-keyboard.conf" read-string))
  24. ;;(define my-touchpad
  25. ;; (call-with-input-file "/etc/config.d/02.touchpad.conf" read-string))
  26. ;; I want to make my touchpad work on tapping
  27. ;; but this is not correct apparently... ;;should I use Driver "evdev" instead? synaptics is newer
  28. (define my-touchpad
  29. "Section \"InputClass\"
  30. Identifier \"touchpad\"
  31. Driver \"libinput\"
  32. MatchIsTouchpad \"on\"
  33. Option \"Tapping\" \"on\"
  34. Option \"TapButtonMap\" \"lmr\"
  35. EndSection")
  36. ;; I want X to use dvorak and swap caps
  37. ;; switch evdev to libinput
  38. (define my-dvorak-evdev
  39. "Section \"InputClass\"
  40. Identifier \"evdev keyboard catchall\"
  41. Driver \"evdev\"
  42. MatchIsKeyBoard \"on\"
  43. Option \"xkb_layout\" \"dvorak\"
  44. Option \"xkb_options\" \"ctrl:swapcaps\"
  45. EndSection")
  46. ;; libinput configuration: https://wayland.freedesktop.org/libinput/doc/1.12.6/configuration.html
  47. ;; I should enable tap to click
  48. ;; https://wiki.archlinux.org/index.php/Libinput#Configuration
  49. ;; Xorg configuration https://linux.die.net/man/5/xorg.conf
  50. (define my-dvorak
  51. "Section \"InputClass\"
  52. Identifier \"libinput keyboard catchall\"
  53. Driver \"libinput\"
  54. MatchIsKeyBoard \"on\"
  55. Option \"xkb_layout\" \"dvorak\"
  56. Option \"xkb_options\" \"ctrl:swapcaps\"
  57. EndSection")
  58. ;; I can use MatchIsTouchPad or MatchIsPointer
  59. (define my-pointer
  60. "Section \"InputClass\"
  61. Identifier \"libinput touchpad catchall\"
  62. Driver \"libinput\"
  63. MatchIsTouchpad \"on\"
  64. EndSection")
  65. ;; archlinux.org libinput page shows how configure libinput
  66. ;; it gives an example of how to do this
  67. ;;"Section \"InputClass\"
  68. ;; Identifier \"devname\"
  69. ;; Driver \"libinput\"
  70. ;; EndSection"
  71. (define %my-user "joshua")
  72. (define %15-minutes (* 15 60))
  73. (define %my-desktop-services
  74. ;; first we modify the services that we want
  75. (modify-services
  76. %desktop-services
  77. ;; first we remove the slim service
  78. ;; (remove (lambda (service)
  79. ;; (or (eq? (service-kind service)
  80. ;; slim-service-type)))
  81. ;; %desktop-services)
  82. (slim-service-type config =>
  83. (slim-configuration
  84. (inherit config)
  85. (auto-login? #t)
  86. (default-user "joshua")
  87. (xorg-configuration
  88. (xorg-configuration ;for X layout
  89. (keyboard-layout (keyboard-layout "dvorak"))))
  90. ;; (startx (xorg-start-command
  91. ;; #:configuration-file
  92. ;; (xorg-configuration-file
  93. ;; #:extra-config
  94. ;; ;;there are some problems with my-touchpad
  95. ;; (list my-dvorak))))
  96. ))
  97. (guix-service-type
  98. config =>
  99. (guix-configuration
  100. (inherit config)
  101. (max-silent-time %15-minutes)
  102. ;; (timeout %15-minutes)
  103. ;; ok specifying the --fallback breaks the daemon. weird.
  104. ;; (extra-options '("--fallback"))
  105. ))))
  106. ;; In Guile-formatted configuration files each command that needs executing
  107. ;; is introduced with the 'job' function. This function always takes two
  108. ;; arguments, the first a time specification, and the second a command
  109. ;; specification. An optional third argument may contain a string to
  110. ;; display when this job is listed in a schedule. Additionally a USER
  111. ;; keyword argument can be supplied to use a different user than the one
  112. ;; defined in 'configuration-user' global variable.
  113. (define my-updatedb-job
  114. ;; Run 'updatedb' at 10AM every day. Here we write the
  115. ;; job's action as a Scheme procedure.
  116. #~(job '(next-hour '(10))
  117. (lambda ()
  118. (execl (string-append #$findutils "/bin/updatedb")
  119. "updatedb"
  120. "--prunepaths=/tmp /var/tmp /gnu/store"))))
  121. (define my-user-guix-pull
  122. ;; Run guix pull daily
  123. #~(job '(next-hour '(10))
  124. "guix pull"
  125. #:user %my-user))
  126. (define my-root-guix-reconfigure
  127. ;; Run sudo guix system reconfigure every week
  128. ;; job's action as a Scheme procedure.
  129. #~(job '(next-week)
  130. "guix system reconfigure /home/joshua/gnu/guix-config/awesome.scm"
  131. #:user %my-user))
  132. (define my-garbage-collector-job
  133. ;; Collect garbage 5 minutes after midnight every day.
  134. ;; The job's action is a shell command.
  135. #~(job '(next-hour '(10)) ;Vixie cron syntax
  136. "guix gc -F 10G"))
  137. (operating-system
  138. (host-name "dobby")
  139. (timezone "America/New_York")
  140. (locale "en_US.utf8")
  141. ;; hopefully this will fix my weird mouse issue if usbkbd is not loaded.
  142. (kernel-arguments '("modprobe.blacklist=usbkbd"))
  143. ;; I think blacklisting libinput may be causing me to always have a mouse that doesn't work.
  144. ;;(kernel-arguments '("modprobe.blacklist=usbkbd,libinput"))
  145. (keyboard-layout (keyboard-layout "dvorak")) ;for the console
  146. (bootloader (bootloader-configuration
  147. (bootloader grub-efi-bootloader)
  148. (target "/boot/efi")
  149. ;;(keyboard-layout keyboard-layout) ;; keyboard layout for grub is not working
  150. (menu-entries (list
  151. (menu-entry
  152. (label "Debian")
  153. (linux "/boot/vmlinuz-4.9.0-8-amd64")
  154. (linux-arguments '("root=/dev/sda6"))
  155. (initrd "/boot/initrd.img-4.9.0-8-amd64"))))))
  156. (file-systems (cons* (file-system
  157. ;; /dev/sda3
  158. (device (file-system-label "root"))
  159. (mount-point "/")
  160. (type "ext4"))
  161. (file-system
  162. ;; /dev/sda4
  163. (device (file-system-label "home"))
  164. (mount-point "/home")
  165. (type "ext4"))
  166. ;;/home doesn't need to execute programs
  167. ;; it shouldn't, but if I mount it that way, I can't log into X
  168. ;;(flags '("no-exec")))
  169. (file-system
  170. (device (file-system-label "prog"))
  171. (mount-point "/home/joshua/prog")
  172. (type "ext4"))
  173. (file-system
  174. (device "/dev/sda1")
  175. (mount-point "/boot/efi")
  176. (type "vfat"))
  177. %base-file-systems))
  178. (swap-devices '("/dev/sda2"))
  179. (users (cons (user-account
  180. (name "joshua")
  181. (comment "Joshua")
  182. (group "users")
  183. ;; Adding the account to the "wheel" group
  184. ;; makes it a sudoer. Adding it to "audio"
  185. ;; and "video" allows the user to play sound
  186. ;; and access the webcam.
  187. (supplementary-groups '("wheel" "kvm"
  188. "audio" "video"))
  189. (home-directory "/home/joshua"))
  190. %base-user-accounts))
  191. ;; Globally-installed packages.
  192. (packages (cons*
  193. ;;awesome
  194. nss-certs
  195. ;;xorg-server-xwayland wayland weston
  196. %base-packages))
  197. ;; add my configured desktop-services
  198. (services (cons*
  199. ;; darkstat may only really be useful for seeing
  200. ;; who views my server
  201. ;; I can view this here:
  202. ;; http://127.0.0.1:667/
  203. (service darkstat-service-type
  204. (darkstat-configuration
  205. (interface "enp0s9")))
  206. ;; (mcron-service (list
  207. ;; my-garbage-collector-job
  208. ;; my-updatedb-job
  209. ;; my-root-guix-reconfigure
  210. ;; my-user-guix-pull
  211. ;; ))
  212. (gnome-desktop-service)
  213. ;;
  214. ;;(service gdm-service-type)
  215. (mysql-service)
  216. (service nginx-service-type
  217. (nginx-configuration
  218. ;;(file "/etc/nginx/nginx.conf")
  219. (server-blocks
  220. (list
  221. (nginx-server-configuration
  222. (server-name (list 'default))
  223. (root "/home/joshua/prog/html/public_html/")
  224. (index (list "index.html"))
  225. ;; (locations
  226. ;; (list
  227. ;; (nginx-location-configuration
  228. ;; (uri "/path1")
  229. ;; (body '("proxy_pass http://server_proxy.com")))))
  230. ))
  231. ;; (nginx-server-configuration
  232. ;; (server-name '("www.hurd.com" "hurd.com"))
  233. ;; (root "/home/joshua/prog/html/hurd.com"))
  234. )))
  235. ;; archive my logs every now and then
  236. ;; I'd like to costimize this to be monthly
  237. ;; instead of the default weekly
  238. (service rottlog-service-type)
  239. ;; (service sddm-service-type
  240. ;; (sddm-configuration
  241. ;; (xorg-server-path (xorg-start-command
  242. ;; #:configuration-file
  243. ;; (xorg-configuration-file
  244. ;; #:extra-config
  245. ;; ;;there are some problems with my-touchpad
  246. ;; (list my-dvorak))))))
  247. ;; make linux use RAM more than it uses swap.
  248. ;; it would be cool to store my config in the store
  249. ;;https://lists.gnu.org/archive/html/help-guix/2017-08/msg00095.html
  250. (service sysctl-service-type
  251. (sysctl-configuration
  252. (settings '(("vm.swappiness" . "30")))))
  253. (service tor-service-type)
  254. %my-desktop-services))
  255. ;;letting weston launch itself
  256. ;; (setuid-programs (cons #~(string-append #$weston "/bin/weston-launch")
  257. ;; %setuid-programs))
  258. (name-service-switch %mdns-host-lookup-nss))