summaryrefslogtreecommitdiff
path: root/gnu/system
diff options
context:
space:
mode:
authorJanneke Nieuwenhuizen <janneke@gnu.org>2020-06-05 09:18:35 +0200
committerJan (janneke) Nieuwenhuizen <janneke@gnu.org>2024-11-11 07:28:33 +0100
commit2390db7f46c73e78abc202e5ad2eee764472baa5 (patch)
tree87cf07d3f0f0ec8c42bfacf914e45bea84360b3f /gnu/system
parentf2cefd700d6fb6ee26a9289b8194524062d2778f (diff)
system: examples: Add devel-hurd.tmpl.
This operating system specification for the Hurd creates a system that supports building the guix package from git natively. Do something like ./pre-inst-env guix system build --target=i586-pc-gnu \ gnu/system/examples/devel-hurd.tmpl ./pre-inst-env guix system image --image-type=hurd-qcow2 --image-size=15G \ --no-offload gnu/system/examples/devel-hurd.tmpl cp /gnu/store/...disk-image devel.img guix shell qemu -- qemu-system-i386 -enable-kvm -m 4096 \ -device rtl8139,netdev=net0 \ -netdev user,id=net0,hostfwd=tcp:127.0.0.1:10022-:2222 \ -hda devel-hurd.img ssh -p 10022 root@localhost GUIX_PROFILE=/run/current-system/bootstrap-profile source $GUIX_PROFILE/etc/profile mkdir -p ~/src/guix cd src/guix git clone git://git.savannah.gnu.org/guix cd guix ./bootstrap ./configure --with-courage make * gnu/system/examples/devel-hurd.tmpl: New file. Change-Id: I097c7c00a9ab9602db7f8f3305827c815f308d1e
Diffstat (limited to 'gnu/system')
-rw-r--r--gnu/system/examples/devel-hurd.tmpl106
1 files changed, 106 insertions, 0 deletions
diff --git a/gnu/system/examples/devel-hurd.tmpl b/gnu/system/examples/devel-hurd.tmpl
new file mode 100644
index 00000000000..3dca0706d1d
--- /dev/null
+++ b/gnu/system/examples/devel-hurd.tmpl
@@ -0,0 +1,106 @@
1;; -*-scheme-*-
2
3;; This is an operating system configuration template for a "bare bones
4;; development" setup, with no X11 display server.
5
6;; To build a disk image for a virtual machine, do
7;;
8;; ./pre-inst-env guix system image --image-type=hurd-qcow2 --image-size=6G \
9;; --no-offload gnu/system/examples/devel-hurd.tmpl
10;;
11;; You may run it like so
12;;
13;; cp /gnu/store/.../disk-image devel-hurd.img
14;; guix shell qemu -- qemu-system-i386 -enable-kvm -m 4096 \
15;; -device rtl8139,netdev=net0 \
16;; -netdev user,id=net0,hostfwd=tcp:127.0.0.1:10022-:2222 \
17;; -hda devel-hurd.img
18;;
19;; and use it like
20;;
21;; ssh -p 10022 root@localhost
22;; guix build -e '(@@ (gnu packages commencement) gnu-make-boot0)'
23;;
24;; or even (if you use --image-size=3G)
25;;
26;; guix build hello
27;;
28;; Building Guix, do something like:
29;;
30;; GUIX_PROFILE=/run/current-system/bootstrap-profile
31;; source $GUIX_PROFILE/etc/profile
32;; mkdir -p ~/src/guix
33;; cd src/guix
34;; git clone https://git.savannah.gnu.org/git/guix.git master
35;; cd master
36;; ./bootstrap
37;; ./configure --with-courage
38;; make
39
40(use-modules (srfi srfi-1)
41 (ice-9 match)
42 (gnu)
43 (gnu system hurd)
44 (gnu system locale)
45 (guix packages)
46 (guix store)
47 (guix utils))
48(use-service-modules ssh virtualization)
49(use-package-modules base compression file gawk gdb hurd less m4
50 package-management ssh version-control)
51
52(define (input->package input)
53 "Return the INPUT as package, or #f."
54 (match input
55 ((label (and (? package?) package))
56 package)
57 ((label (and (? package?) package . output))
58 (cons package output))
59 (_ #f)))
60
61(define guix-packages
62 (filter-map input->package
63 (fold alist-delete (package-direct-inputs guix)
64 ;; These are not essential and do not build yet.
65 '("graphviz" "guile-avahi" "po4a"))))
66
67(define %hurd-devel-os
68 (operating-system
69 (inherit %hurd-vm-operating-system)
70 (host-name "guixydevel")
71 (timezone "Europe/Berlin")
72 (file-systems (cons (file-system
73 (device (file-system-label "hurd"))
74 (mount-point "/")
75 (type "ext2"))
76 %base-file-systems))
77 (swap-devices (list (swap-space
78 (target "/swapfile"))))
79 (users (cons (user-account
80 (name "guix")
81 (group "users")
82 (supplementary-groups '("wheel")))
83 %base-user-accounts))
84 (packages (cons*
85 gdb-minimal
86 git-minimal
87 gnu-make
88 m4
89 openssh-sans-x
90 (append
91 guix-packages
92 %base-packages/hurd)))
93 (services (cons*
94 (modify-services (operating-system-user-services
95 %hurd-vm-operating-system)
96 (openssh-service-type
97 config =>
98 ;; Set wide open
99 (openssh-configuration
100 (openssh openssh-sans-x)
101 (port-number 2222)
102 (permit-root-login #t)
103 (allow-empty-passwords? #t)
104 (password-authentication? #t))))))))
105
106%hurd-devel-os