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>
5 ;;; This file is part of GNU Guix.
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.
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.
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/>.
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 cross-base)
30 #:use-module (gnu packages file)
31 #:use-module (gnu packages guile)
32 #:use-module (gnu packages guile-xyz)
33 #:use-module (gnu packages hurd)
34 #:use-module (gnu packages less)
35 #:use-module (gnu services)
36 #:use-module (gnu services base)
37 #:use-module (gnu services hurd)
38 #:use-module (gnu services shepherd)
39 #:use-module (gnu system)
40 #:use-module (gnu system shadow)
41 #:use-module (gnu system vm)
42 #:export (%base-packages/hurd
44 %hurd-default-operating-system
45 %hurd-default-operating-system-kernel
46 %setuid-programs/hurd))
50 ;;; This module provides system-specifics for the GNU/Hurd operating system
51 ;;; and virtual machine.
55 (define %hurd-default-operating-system-kernel
58 ;; A cross-built GNUmach does not work
59 (with-parameters ((%current-system "i686-linux")
60 (%current-target-system #f))
63 (define %base-packages/hurd
64 (list hurd bash coreutils file findutils grep sed
65 guile-3.0-latest guile-colorized guile-readline
66 net-base inetutils less shadow shepherd sudo which))
68 (define %base-services/hurd
69 (list (service hurd-console-service-type
70 (hurd-console-configuration (hurd hurd)))
71 (service hurd-getty-service-type (hurd-getty-configuration
73 (service hurd-getty-service-type (hurd-getty-configuration
75 (service static-networking-service-type
76 (list (static-networking (interface "lo")
79 (provision '(loopback))
80 (name-servers '("10.0.2.3")))))
82 (service guix-service-type
84 (extra-options '("--disable-chroot"
85 "--disable-deduplication"))))
86 (service special-files-service-type
87 `(("/bin/sh" ,(file-append bash "/bin/sh"))
88 ("/usr/bin/env" ,(file-append coreutils "/bin/env"))))))
90 (define %setuid-programs/hurd
91 ;; Default set of setuid-root programs.
92 (list (file-append shadow "/bin/passwd")
93 (file-append shadow "/bin/sg")
94 (file-append shadow "/bin/su")
95 (file-append shadow "/bin/newgrp")
96 (file-append shadow "/bin/newuidmap")
97 (file-append shadow "/bin/newgidmap")
98 (file-append sudo "/bin/sudo")
99 (file-append sudo "/bin/sudoedit")))
101 (define %hurd-default-operating-system
103 (kernel %hurd-default-operating-system-kernel)
104 (kernel-arguments '())
106 (bootloader (bootloader-configuration
107 (bootloader grub-minimal-bootloader)
108 (target "/dev/vda")))
110 (initrd-modules (lambda _ '()))
112 (host-name "guixygnu")
114 (packages %base-packages/hurd)
116 (name-service-switch #f)
117 (essential-services (hurd-default-essential-services this-operating-system))
118 (setuid-programs %setuid-programs/hurd)))