image: Move hurd image definition to a dedicated file.
[jackhill/guix/guix.git] / gnu / system / images / hurd.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2020 Mathieu Othacehe <m.othacehe@gmail.com>
3 ;;;
4 ;;; This file is part of GNU Guix.
5 ;;;
6 ;;; GNU Guix is free software; you can redistribute it and/or modify it
7 ;;; under the terms of the GNU General Public License as published by
8 ;;; the Free Software Foundation; either version 3 of the License, or (at
9 ;;; your option) any later version.
10 ;;;
11 ;;; GNU Guix is distributed in the hope that it will be useful, but
12 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
13 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 ;;; GNU General Public License for more details.
15 ;;;
16 ;;; You should have received a copy of the GNU General Public License
17 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
18
19 (define-module (gnu system images hurd)
20 #:use-module (guix gexp)
21 #:use-module (gnu bootloader)
22 #:use-module (gnu bootloader grub)
23 #:use-module (gnu image)
24 #:use-module (gnu packages ssh)
25 #:use-module (gnu services)
26 #:use-module (gnu services ssh)
27 #:use-module (gnu system)
28 #:use-module (gnu system file-systems)
29 #:use-module (gnu system hurd)
30 #:use-module (gnu system image)
31 #:export (hurd-barebones-os
32 hurd-disk-image
33 hurd-barebones-disk-image))
34
35 (define hurd-barebones-os
36 (operating-system
37 (inherit %hurd-default-operating-system)
38 (bootloader (bootloader-configuration
39 (bootloader grub-minimal-bootloader)
40 (target "/dev/sdX")))
41 (file-systems (cons (file-system
42 (device (file-system-label "my-root"))
43 (mount-point "/")
44 (type "ext2"))
45 %base-file-systems))
46 (host-name "guixygnu")
47 (timezone "Europe/Amsterdam")
48 (packages (cons openssh-sans-x %base-packages/hurd))
49 (services (cons (service openssh-service-type
50 (openssh-configuration
51 (openssh openssh-sans-x)
52 (use-pam? #f)
53 (port-number 2222)
54 (permit-root-login #t)
55 (allow-empty-passwords? #t)
56 (password-authentication? #t)))
57 %base-services/hurd))))
58
59 (define hurd-disk-image
60 (image
61 (format 'disk-image)
62 (target "i586-pc-gnu")
63 (partitions
64 (list (partition
65 (size 'guess)
66 (offset root-offset)
67 (label root-label)
68 (file-system "ext2")
69 (flags '(boot))
70 (initializer (gexp initialize-root-partition)))))))
71
72 (define hurd-barebones-disk-image
73 (image
74 (inherit hurd-disk-image)
75 (name 'hurd-barebones-disk-image)
76 (operating-system hurd-barebones-os)))