hurd.scm 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. ;;; GNU Guix --- Functional package management for GNU
  2. ;;; Copyright © 2020 Ludovic Courtès <ludo@gnu.org>
  3. ;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
  4. ;;;
  5. ;;; This file is part of GNU Guix.
  6. ;;;
  7. ;;; GNU Guix is free software; you can redistribute it and/or modify it
  8. ;;; under the terms of the GNU General Public License as published by
  9. ;;; the Free Software Foundation; either version 3 of the License, or (at
  10. ;;; your option) any later version.
  11. ;;;
  12. ;;; GNU Guix is distributed in the hope that it will be useful, but
  13. ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
  14. ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. ;;; GNU General Public License for more details.
  16. ;;;
  17. ;;; You should have received a copy of the GNU General Public License
  18. ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
  19. (define-module (gnu system hurd)
  20. #:use-module (guix gexp)
  21. #:use-module (guix profiles)
  22. #:use-module (guix utils)
  23. #:use-module (gnu bootloader)
  24. #:use-module (gnu bootloader grub)
  25. #:use-module (gnu packages admin)
  26. #:use-module (gnu packages base)
  27. #:use-module (gnu packages bash)
  28. #:use-module (gnu packages compression)
  29. #:use-module (gnu packages cross-base)
  30. #:use-module (gnu packages file)
  31. #:use-module (gnu packages gawk)
  32. #:use-module (gnu packages guile)
  33. #:use-module (gnu packages guile-xyz)
  34. #:use-module (gnu packages hurd)
  35. #:use-module (gnu packages less)
  36. #:use-module (gnu services)
  37. #:use-module (gnu services base)
  38. #:use-module (gnu services hurd)
  39. #:use-module (gnu services shepherd)
  40. #:use-module (gnu system)
  41. #:use-module (gnu system shadow)
  42. #:use-module (gnu system vm)
  43. #:export (%base-packages/hurd
  44. %base-services/hurd
  45. %hurd-default-operating-system
  46. %hurd-default-operating-system-kernel
  47. %setuid-programs/hurd))
  48. ;;; Commentary:
  49. ;;;
  50. ;;; This module provides system-specifics for the GNU/Hurd operating system
  51. ;;; and virtual machine.
  52. ;;;
  53. ;;; Code:
  54. (define %hurd-default-operating-system-kernel
  55. (if (hurd-system?)
  56. gnumach
  57. ;; A cross-built GNUmach does not work
  58. (with-parameters ((%current-system "i686-linux")
  59. (%current-target-system #f))
  60. gnumach)))
  61. (define %base-packages/hurd
  62. (list hurd bash coreutils file findutils grep sed
  63. diffutils patch gawk tar gzip bzip2 xz lzip
  64. guile-3.0-latest guile-colorized guile-readline
  65. net-base inetutils less shadow shepherd sudo which))
  66. (define %base-services/hurd
  67. (list (service hurd-console-service-type
  68. (hurd-console-configuration (hurd hurd)))
  69. (service hurd-getty-service-type (hurd-getty-configuration
  70. (tty "tty1")))
  71. (service hurd-getty-service-type (hurd-getty-configuration
  72. (tty "tty2")))
  73. (service static-networking-service-type
  74. (list (static-networking (interface "lo")
  75. (ip "127.0.0.1")
  76. (requirement '())
  77. (provision '(loopback))
  78. (name-servers '("10.0.2.3")))))
  79. (syslog-service)
  80. (service guix-service-type
  81. (guix-configuration
  82. (extra-options '("--disable-chroot"
  83. "--disable-deduplication"))))
  84. (service special-files-service-type
  85. `(("/bin/sh" ,(file-append bash "/bin/sh"))
  86. ("/usr/bin/env" ,(file-append coreutils "/bin/env"))))))
  87. (define %setuid-programs/hurd
  88. ;; Default set of setuid-root programs.
  89. (list (file-append shadow "/bin/passwd")
  90. (file-append shadow "/bin/sg")
  91. (file-append shadow "/bin/su")
  92. (file-append shadow "/bin/newgrp")
  93. (file-append shadow "/bin/newuidmap")
  94. (file-append shadow "/bin/newgidmap")
  95. (file-append sudo "/bin/sudo")
  96. (file-append sudo "/bin/sudoedit")))
  97. (define %hurd-default-operating-system
  98. (operating-system
  99. (kernel %hurd-default-operating-system-kernel)
  100. (kernel-arguments '())
  101. (hurd hurd)
  102. (bootloader (bootloader-configuration
  103. (bootloader grub-minimal-bootloader)
  104. (target "/dev/vda")))
  105. (initrd #f)
  106. (initrd-modules (lambda _ '()))
  107. (firmware '())
  108. (host-name "guixygnu")
  109. (file-systems '())
  110. (packages %base-packages/hurd)
  111. (timezone "GNUrope")
  112. (name-service-switch #f)
  113. (essential-services (hurd-default-essential-services this-operating-system))
  114. (setuid-programs %setuid-programs/hurd)))