mastostart.scm 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. (define-module (mastostart-gnu system mastostart)
  2. #:use-module (gnu)
  3. #:use-module (guix packages)
  4. #:use-module (gnu packages databases)
  5. #:use-module (guix packages)
  6. #:use-module (guix build syscalls)
  7. #:use-module (guix monads)
  8. #:use-module (guix store)
  9. #:use-module (guix gexp)
  10. #:use-module (mastostart-gnu services mastostart))
  11. (use-service-modules databases
  12. networking
  13. shepherd
  14. ssh
  15. web)
  16. (define-public %apache-listen-ports '("8080"))
  17. (define-public %apache-server-name "127.0.0.1")
  18. (define-public %apache-webroot "/srv")
  19. (define-public %apache-conf
  20. (string-append "
  21. <Directory / >
  22. Options FollowSymLinks
  23. AllowOverride All
  24. </Directory>
  25. <FilesMatch \\.php$>
  26. SetHandler \"proxy:unix:/var/run/php-fpm.sock|fcgi://localhost/\"
  27. </FilesMatch>"))
  28. (define-public mastostart-conf
  29. (operating-system
  30. (locale "it_IT.utf8")
  31. (timezone "Europe/Rome")
  32. (host-name "mastostart")
  33. (keyboard-layout
  34. (keyboard-layout "it" "nodeadkeys"))
  35. (bootloader
  36. (bootloader-configuration
  37. (bootloader grub-bootloader)
  38. (target "/dev/sda")
  39. (keyboard-layout keyboard-layout)))
  40. (file-systems
  41. (cons* (file-system
  42. (mount-point "/")
  43. (device (file-system-label "root"))
  44. (type "ext4"))
  45. %base-file-systems))
  46. (packages
  47. (append
  48. (map specification->package
  49. '("glibc-utf8-locales"
  50. "font-dejavu"
  51. "font-gnu-freefont"
  52. "gs-fonts"
  53. "mariadb"
  54. "php"
  55. "rsync"))
  56. %base-packages))
  57. (services
  58. (append
  59. (list (service dhcp-client-service-type)
  60. (mysql-service)
  61. (service mastostart-service-type
  62. (mastostart-configuration
  63. (webroot %apache-webroot)))
  64. (service openssh-service-type
  65. (openssh-configuration
  66. (port-number 10022)
  67. (permit-root-login #t)))
  68. (service httpd-service-type
  69. (httpd-configuration
  70. (config
  71. (httpd-config-file
  72. (server-name %apache-server-name)
  73. (listen %apache-listen-ports)
  74. (document-root %apache-webroot)
  75. (modules (cons*
  76. (httpd-module
  77. (name "rewrite_module")
  78. (file "modules/mod_rewrite.so"))
  79. (httpd-module
  80. (name "proxy_module")
  81. (file "modules/mod_proxy.so"))
  82. (httpd-module
  83. (name "proxy_fcgi_module")
  84. (file "modules/mod_proxy_fcgi.so"))
  85. %default-httpd-modules))
  86. (extra-config (list %apache-conf))))))
  87. (service php-fpm-service-type
  88. (php-fpm-configuration
  89. (socket "/var/run/php-fpm.sock")
  90. (socket-group "httpd")))
  91. (extra-special-file "/usr/bin/env"
  92. (file-append coreutils "/bin/env")))
  93. %base-services))))
  94. mastostart-conf