| 1 | ;; -*-scheme-*-
|
| 2 |
|
| 3 | ;; This is an operating system configuration template
|
| 4 | ;; for a "bare bones" QEMU 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 \
|
| 9 | ;; gnu/system/examples/bare-hurd.tmpl
|
| 10 | ;;
|
| 11 | ;; You may run it like so:
|
| 12 | ;;
|
| 13 | ;; guix shell qemu -- qemu-system-i386 -m 2048 \
|
| 14 | ;; --enable-kvm \
|
| 15 | ;; --device e1000,netdev=net0 \
|
| 16 | ;; --netdev user,id=net0,hostfwd=tcp:127.0.0.1:10022-:2222 \
|
| 17 | ;; --snapshot \
|
| 18 | ;; --hda /gnu/store/...-disk-image
|
| 19 | ;;
|
| 20 | ;; and use it like:
|
| 21 | ;;
|
| 22 | ;; ssh -p 10022 root@localhost
|
| 23 | ;; guix build -e '(@@ (gnu packages commencement) gnu-make-boot0)'
|
| 24 | ;;
|
| 25 | ;; or even, if you build the image with at least --image-size=3G:
|
| 26 | ;;
|
| 27 | ;; guix build hello
|
| 28 |
|
| 29 | (use-modules (gnu) (gnu system hurd) (guix utils))
|
| 30 | (use-service-modules ssh)
|
| 31 | (use-package-modules ssh)
|
| 32 |
|
| 33 | (define %hurd-os
|
| 34 | (operating-system
|
| 35 | (inherit %hurd-default-operating-system)
|
| 36 | (bootloader (bootloader-configuration
|
| 37 | (bootloader grub-minimal-bootloader)
|
| 38 | (targets '("/dev/sdX"))))
|
| 39 | (file-systems (cons (file-system
|
| 40 | (device (file-system-label "hurd"))
|
| 41 | (mount-point "/")
|
| 42 | (type "ext2"))
|
| 43 | %base-file-systems))
|
| 44 | (host-name "guixygnu")
|
| 45 | (timezone "Europe/Amsterdam")
|
| 46 | (users (cons (user-account
|
| 47 | (name "guix")
|
| 48 | (comment "Anonymous Hurd Hacker")
|
| 49 | (group "users")
|
| 50 | (supplementary-groups '("wheel")))
|
| 51 | %base-user-accounts))
|
| 52 | (packages (cons openssh-sans-x %base-packages/hurd))
|
| 53 | (services (cons (service openssh-service-type
|
| 54 | (openssh-configuration
|
| 55 | (openssh openssh-sans-x)
|
| 56 | (port-number 2222)
|
| 57 | (permit-root-login #t)
|
| 58 | (allow-empty-passwords? #t)
|
| 59 | (password-authentication? #t)))
|
| 60 | ;; For installing on a real (non-QEMU) machine, use:
|
| 61 | ;; (static-networking-service-type
|
| 62 | ;; (list %loopback-static-networking
|
| 63 | ;; (static-networking
|
| 64 | ;; ...)))
|
| 65 | ;; %base-services/hurd
|
| 66 | %base-services+qemu-networking/hurd))))
|
| 67 |
|
| 68 | %hurd-os
|