minimal-httpd.scm 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. (add-to-load-path "/home/ton/guixsd/modules/")
  2. (setenv "GUIX_PACKAGE_PATH" "/home/ton/guixsd/modules/:$GUIX_PACKAGE_PATH")
  3. (use-modules
  4. (gnu)
  5. (gnu system)
  6. (gnu tests)
  7. (gnu system nss)
  8. (gnu packages libusb)
  9. (guix monads)
  10. (guix store)
  11. (ice-9 rdelim)
  12. (srfi srfi-1)
  13. (ton-tull)
  14. )
  15. (use-service-modules
  16. desktop base xorg ssh avahi dbus networking cups mcron virtualization
  17. web pm)
  18. (use-package-modules
  19. avahi xorg certs wm code wget admin emacs tmux
  20. ssh linux disk file gnuzilla version-control maths guile crypto gnupg
  21. password-utils rsync suckless gnome video xdisorg
  22. terminals ssh image-viewers web-browsers pulseaudio
  23. tex tor readline adns fontutils gnunet package-management
  24. networking connman lisp cryptsetup fonts python
  25. bittorrent engineering graphviz shells compression
  26. gnome enlightenment dns ghostscript kde-frameworks bash backup)
  27. (define %index.html-contents
  28. ;; Contents of the /index.html file.
  29. "Hello, guix!")
  30. (define %make-http-root
  31. ;; Create our server root in /srv.
  32. #~(begin
  33. (mkdir "/srv")
  34. (mkdir "/srv/http")
  35. (call-with-output-file "/srv/http/index.html"
  36. (lambda (port)
  37. (display #$%index.html-contents port)))))
  38. (define %httpd-os
  39. (simple-operating-system
  40. (dhcp-client-service)
  41. (service httpd-service-type
  42. (httpd-configuration
  43. (config
  44. (httpd-config-file
  45. (listen '("8080"))))))
  46. (simple-service 'make-http-root activation-service-type
  47. %make-http-root)))
  48. %httpd-os