image: Rename "raw" image-type to "efi-raw".
[jackhill/guix/guix.git] / gnu / system / hurd.scm
CommitLineData
a9f7993e
LC
1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2020 Ludovic Courtès <ludo@gnu.org>
3eb4b466 3;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
a9f7993e
LC
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)
c6212694 22 #:use-module (guix profiles)
a9f7993e 23 #:use-module (guix utils)
59bcffa3 24 #:use-module (gnu bootloader)
a9f7993e 25 #:use-module (gnu bootloader grub)
db047a48 26 #:use-module (gnu packages admin)
a9f7993e 27 #:use-module (gnu packages base)
fe1f9646 28 #:use-module (gnu packages bash)
d56d79b1 29 #:use-module (gnu packages compression)
a9f7993e 30 #:use-module (gnu packages cross-base)
da987ece 31 #:use-module (gnu packages file)
d56d79b1 32 #:use-module (gnu packages gawk)
da987ece 33 #:use-module (gnu packages guile)
5084fd38 34 #:use-module (gnu packages guile-xyz)
a9f7993e 35 #:use-module (gnu packages hurd)
9b0c047c 36 #:use-module (gnu packages less)
59bcffa3
JN
37 #:use-module (gnu services)
38 #:use-module (gnu services base)
39 #:use-module (gnu services hurd)
40 #:use-module (gnu services shepherd)
41 #:use-module (gnu system)
42 #:use-module (gnu system shadow)
a9f7993e 43 #:use-module (gnu system vm)
60fdd9e3 44 #:export (%base-packages/hurd
59bcffa3
JN
45 %base-services/hurd
46 %hurd-default-operating-system
16f8ea06
JN
47 %hurd-default-operating-system-kernel
48 %setuid-programs/hurd))
a9f7993e
LC
49
50;;; Commentary:
51;;;
60fdd9e3
JN
52;;; This module provides system-specifics for the GNU/Hurd operating system
53;;; and virtual machine.
a9f7993e
LC
54;;;
55;;; Code:
56
59bcffa3
JN
57(define %hurd-default-operating-system-kernel
58 (if (hurd-system?)
59 gnumach
60 ;; A cross-built GNUmach does not work
61 (with-parameters ((%current-system "i686-linux")
62 (%current-target-system #f))
63 gnumach)))
64
da987ece 65(define %base-packages/hurd
5084fd38 66 (list hurd bash coreutils file findutils grep sed
d56d79b1 67 diffutils patch gawk tar gzip bzip2 xz lzip
1103f878 68 guile-3.0-latest guile-colorized guile-readline
16f8ea06 69 net-base inetutils less shadow shepherd sudo which))
59bcffa3
JN
70
71(define %base-services/hurd
11e4200f
JN
72 (list (service hurd-console-service-type
73 (hurd-console-configuration (hurd hurd)))
74 (service hurd-getty-service-type (hurd-getty-configuration
75 (tty "tty1")))
76 (service hurd-getty-service-type (hurd-getty-configuration
77 (tty "tty2")))
78 (service static-networking-service-type
79 (list (static-networking (interface "lo")
80 (ip "127.0.0.1")
81 (requirement '())
82 (provision '(loopback))
83 (name-servers '("10.0.2.3")))))
84 (syslog-service)
85 (service guix-service-type
86 (guix-configuration
87 (extra-options '("--disable-chroot"
f817a0c0
JN
88 "--disable-deduplication"))))
89 (service special-files-service-type
90 `(("/bin/sh" ,(file-append bash "/bin/sh"))
91 ("/usr/bin/env" ,(file-append coreutils "/bin/env"))))))
59bcffa3 92
16f8ea06
JN
93(define %setuid-programs/hurd
94 ;; Default set of setuid-root programs.
95 (list (file-append shadow "/bin/passwd")
96 (file-append shadow "/bin/sg")
97 (file-append shadow "/bin/su")
98 (file-append shadow "/bin/newgrp")
99 (file-append shadow "/bin/newuidmap")
100 (file-append shadow "/bin/newgidmap")
101 (file-append sudo "/bin/sudo")
102 (file-append sudo "/bin/sudoedit")))
103
59bcffa3
JN
104(define %hurd-default-operating-system
105 (operating-system
106 (kernel %hurd-default-operating-system-kernel)
107 (kernel-arguments '())
108 (hurd hurd)
109 (bootloader (bootloader-configuration
110 (bootloader grub-minimal-bootloader)
111 (target "/dev/vda")))
5164d7fd 112 (initrd #f)
59bcffa3
JN
113 (initrd-modules (lambda _ '()))
114 (firmware '())
115 (host-name "guixygnu")
116 (file-systems '())
117 (packages %base-packages/hurd)
118 (timezone "GNUrope")
119 (name-service-switch #f)
120 (essential-services (hurd-default-essential-services this-operating-system))
16f8ea06 121 (setuid-programs %setuid-programs/hurd)))