1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2020 Mathieu Othacehe <m.othacehe@gmail.com>
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 images hurd)
21 #:use-module (guix gexp)
22 #:use-module (gnu bootloader)
23 #:use-module (gnu bootloader grub)
24 #:use-module (gnu image)
25 #:use-module (gnu packages ssh)
26 #:use-module (gnu services)
27 #:use-module (gnu services ssh)
28 #:use-module (gnu system)
29 #:use-module (gnu system file-systems)
30 #:use-module (gnu system hurd)
31 #:use-module (gnu system image)
32 #:use-module (srfi srfi-26)
33 #:export (hurd-barebones-os
37 hurd-barebones-disk-image
38 hurd-barebones-qcow2-image))
40 (define hurd-barebones-os
42 (inherit %hurd-default-operating-system)
43 (bootloader (bootloader-configuration
44 (bootloader grub-minimal-bootloader)
46 (file-systems (cons (file-system
47 (device (file-system-label "my-root"))
51 (host-name "guixygnu")
52 (timezone "Europe/Amsterdam")
53 (packages (cons openssh-sans-x %base-packages/hurd))
54 (services (cons (service openssh-service-type
55 (openssh-configuration
56 (openssh openssh-sans-x)
59 (permit-root-login #t)
60 (allow-empty-passwords? #t)
61 (password-authentication? #t)))
62 %base-services/hurd))))
64 (define hurd-initialize-root-partition
65 #~(lambda* (#:rest args)
66 (apply initialize-root-partition
68 (list #:make-device-nodes make-hurd-device-nodes
69 ;; XXX Creating a db.sqlite with journal_mode=WAL
70 ;; yields "unable to open database file" on GNU/Hurd
71 ;; for an sqlite with the hurd-locking-mode.patch;
72 ;; see <https://bugs.gnu.org/42151>.
75 (define hurd-disk-image
78 (target "i586-pc-gnu")
85 (file-system-options '("-o" "hurd" "-O" "ext_attr"))
87 (initializer hurd-initialize-root-partition))))))
89 (define hurd-image-type
92 (constructor (cut image-with-os hurd-disk-image <>))))
94 (define hurd-qcow2-image-type
97 (constructor (lambda (os)
99 (inherit hurd-disk-image)
100 (format 'compressed-qcow2)
101 (operating-system os))))))
103 (define hurd-barebones-disk-image
106 (os->image hurd-barebones-os #:type hurd-image-type))
107 (name 'hurd-barebones-disk-image)))
109 (define hurd-barebones-qcow2-image
112 (os->image hurd-barebones-os #:type hurd-qcow2-image-type))
113 (name 'hurd-barebones.qcow2)))
115 ;; Return the default image.
116 hurd-barebones-qcow2-image