gnu: emacs-helm: Update to 3.8.7.
[jackhill/guix/guix.git] / gnu / system / hurd.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2020-2022 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
20 (define-module (gnu system hurd)
21 #:use-module (guix gexp)
22 #:use-module (guix profiles)
23 #:use-module (guix utils)
24 #:use-module (gnu bootloader)
25 #:use-module (gnu bootloader grub)
26 #:use-module (gnu packages admin)
27 #:use-module (gnu packages base)
28 #:use-module (gnu packages bash)
29 #:use-module (gnu packages compression)
30 #:use-module (gnu packages cross-base)
31 #:use-module (gnu packages file)
32 #:use-module (gnu packages gawk)
33 #:use-module (gnu packages guile)
34 #:use-module (gnu packages guile-xyz)
35 #:use-module (gnu packages hurd)
36 #:use-module (gnu packages less)
37 #:use-module (gnu packages texinfo)
38 #:use-module (gnu services)
39 #:use-module (gnu services base)
40 #:use-module (gnu services hurd)
41 #:use-module (gnu services shepherd)
42 #:use-module (gnu system)
43 #:use-module (gnu system setuid)
44 #:use-module (gnu system shadow)
45 #:use-module (gnu system vm)
46 #:export (%base-packages/hurd
47 %base-services/hurd
48 %hurd-default-operating-system
49 %hurd-default-operating-system-kernel
50 %setuid-programs/hurd))
51
52 ;;; Commentary:
53 ;;;
54 ;;; This module provides system-specifics for the GNU/Hurd operating system
55 ;;; and virtual machine.
56 ;;;
57 ;;; Code:
58
59 (define %hurd-default-operating-system-kernel
60 (if (hurd-system?)
61 gnumach
62 ;; A cross-built GNUmach does not work
63 (with-parameters ((%current-system "i686-linux")
64 (%current-target-system #f))
65 gnumach)))
66
67 (define %base-packages/hurd
68 ;; Note: the Shepherd comes before the Hurd, not just because its duty is to
69 ;; shepherd the herd, but also because we want its 'halt' and 'reboot'
70 ;; commands to take precedence.
71 (list shepherd hurd bash coreutils file findutils grep sed
72 diffutils patch gawk tar gzip bzip2 xz lzip
73 guile-3.0-latest guile-colorized guile-readline
74 net-base inetutils less shadow sudo which
75 info-reader))
76
77 (define %base-services/hurd
78 (list (service hurd-console-service-type
79 (hurd-console-configuration (hurd hurd)))
80 (service hurd-getty-service-type (hurd-getty-configuration
81 (tty "tty1")))
82 (service hurd-getty-service-type (hurd-getty-configuration
83 (tty "tty2")))
84 (service static-networking-service-type
85 (list %loopback-static-networking
86
87 ;; QEMU user-mode networking. To get "eth0", you need
88 ;; QEMU to emulate a device for which Mach has an
89 ;; in-kernel driver, for instance with:
90 ;; --device rtl8139,netdev=net0 --netdev user,id=net0
91 %qemu-static-networking))
92 (syslog-service)
93 (service guix-service-type
94 (guix-configuration
95 (extra-options '("--disable-chroot"
96 "--disable-deduplication"))))
97 (service special-files-service-type
98 `(("/bin/sh" ,(file-append bash "/bin/sh"))
99 ("/usr/bin/env" ,(file-append coreutils "/bin/env"))))))
100
101 (define %setuid-programs/hurd
102 ;; Default set of setuid-root programs.
103 (map file-like->setuid-program
104 (list (file-append shadow "/bin/passwd")
105 (file-append shadow "/bin/sg")
106 (file-append shadow "/bin/su")
107 (file-append shadow "/bin/newgrp")
108 (file-append shadow "/bin/newuidmap")
109 (file-append shadow "/bin/newgidmap")
110 (file-append sudo "/bin/sudo")
111 (file-append sudo "/bin/sudoedit"))))
112
113 (define %hurd-default-operating-system
114 (operating-system
115 (kernel %hurd-default-operating-system-kernel)
116 (kernel-arguments '())
117 (hurd hurd)
118 (bootloader (bootloader-configuration
119 (bootloader grub-minimal-bootloader)
120 (targets '("/dev/vda"))))
121 (initrd #f)
122 (initrd-modules '())
123 (firmware '())
124 (host-name "guixygnu")
125 (file-systems '())
126 (packages %base-packages/hurd)
127 (timezone "GNUrope")
128 (name-service-switch #f)
129 (essential-services (hurd-default-essential-services this-operating-system))
130 (setuid-programs %setuid-programs/hurd)))