You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

103 lines
2.6 KiB

  1. ;;; GNU Guix --- Functional package management for GNU
  2. ;;; Copyright © 2018 Mathieu Othacehe <m.othacehe@gmail.com>
  3. ;;;
  4. ;;; This file is part of GNU Guix.
  5. ;;;
  6. ;;; GNU Guix is free software; you can redistribute it and/or modify it
  7. ;;; under the terms of the GNU General Public License as published by
  8. ;;; the Free Software Foundation; either version 3 of the License, or (at
  9. ;;; your option) any later version.
  10. ;;;
  11. ;;; GNU Guix is distributed in the hope that it will be useful, but
  12. ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
  13. ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. ;;; GNU General Public License for more details.
  15. ;;;
  16. ;;; You should have received a copy of the GNU General Public License
  17. ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
  18. (define-module (gnu installer newt)
  19. #:use-module (gnu installer)
  20. #:use-module (guix discovery)
  21. #:use-module (guix gexp)
  22. #:use-module (guix ui)
  23. #:export (newt-installer))
  24. (define (modules)
  25. (cons '(newt)
  26. (map module-name
  27. (scheme-modules
  28. (dirname (search-path %load-path "guix.scm"))
  29. "gnu/installer/newt"
  30. #:warn warn-about-load-error))))
  31. (define init
  32. #~(begin
  33. (newt-init)
  34. (clear-screen)
  35. (set-screen-size!)))
  36. (define exit
  37. #~(begin
  38. (newt-finish)))
  39. (define exit-error
  40. #~(lambda (key args)
  41. (newt-finish)))
  42. (define locale-page
  43. #~(lambda* (#:key
  44. supported-locales
  45. iso639-languages
  46. iso3166-territories)
  47. (run-locale-page
  48. #:supported-locales supported-locales
  49. #:iso639-languages iso639-languages
  50. #:iso3166-territories iso3166-territories)))
  51. (define timezone-page
  52. #~(lambda* (zonetab)
  53. (run-timezone-page zonetab)))
  54. (define logo
  55. (string-append
  56. (dirname (search-path %load-path "guix.scm"))
  57. "/gnu/installer/aux-files/logo.txt"))
  58. (define welcome-page
  59. #~(run-welcome-page #$(local-file logo)))
  60. (define menu-page
  61. #~(lambda (steps)
  62. (run-menu-page steps)))
  63. (define keymap-page
  64. #~(lambda* (#:key models layouts)
  65. (run-keymap-page #:models models
  66. #:layouts layouts)))
  67. (define network-page
  68. #~(run-network-page))
  69. (define hostname-page
  70. #~(run-hostname-page))
  71. (define user-page
  72. #~(run-user-page))
  73. (define newt-installer
  74. (installer
  75. (name 'newt)
  76. (modules (modules))
  77. (init init)
  78. (exit exit)
  79. (exit-error exit-error)
  80. (keymap-page keymap-page)
  81. (locale-page locale-page)
  82. (menu-page menu-page)
  83. (network-page network-page)
  84. (timezone-page timezone-page)
  85. (hostname-page hostname-page)
  86. (user-page user-page)
  87. (welcome-page welcome-page)))