summary refs log tree commit diff
path: root/gnu/system/examples
diff options
context:
space:
mode:
authorEfraim Flashner <efraim@flashner.co.il>2023-01-30 11:33:18 +0200
committerEfraim Flashner <efraim@flashner.co.il>2023-01-30 12:39:40 +0200
commit4cf1acc7f3033b50b0bf19e02c9f522d522d338c (patch)
tree9fd64956ee60304c15387eb394cd649e49f01467 /gnu/system/examples
parentedb8c09addd186d9538d43b12af74d6c7aeea082 (diff)
parent595b53b74e3ef57a1c0c96108ba86d38a170a241 (diff)
downloadguix-4cf1acc7f3033b50b0bf19e02c9f522d522d338c.tar.gz
Merge remote-tracking branch 'origin/master' into core-updates
 Conflicts:
	doc/guix.texi
	gnu/local.mk
	gnu/packages/admin.scm
	gnu/packages/base.scm
	gnu/packages/chromium.scm
	gnu/packages/compression.scm
	gnu/packages/databases.scm
	gnu/packages/diffoscope.scm
	gnu/packages/freedesktop.scm
	gnu/packages/gnome.scm
	gnu/packages/gnupg.scm
	gnu/packages/guile.scm
	gnu/packages/inkscape.scm
	gnu/packages/llvm.scm
	gnu/packages/openldap.scm
	gnu/packages/pciutils.scm
	gnu/packages/ruby.scm
	gnu/packages/samba.scm
	gnu/packages/sqlite.scm
	gnu/packages/statistics.scm
	gnu/packages/syndication.scm
	gnu/packages/tex.scm
	gnu/packages/tls.scm
	gnu/packages/version-control.scm
	gnu/packages/xml.scm
	guix/build-system/copy.scm
	guix/scripts/home.scm
Diffstat (limited to 'gnu/system/examples')
-rw-r--r--gnu/system/examples/asus-c201.tmpl1
-rw-r--r--gnu/system/examples/bare-bones.tmpl4
-rw-r--r--gnu/system/examples/beaglebone-black.tmpl1
-rw-r--r--gnu/system/examples/desktop.tmpl1
-rw-r--r--gnu/system/examples/docker-image.tmpl1
-rw-r--r--gnu/system/examples/lightweight-desktop.tmpl1
-rw-r--r--gnu/system/examples/raspberry-pi-64-nfs-root.tmpl71
-rw-r--r--gnu/system/examples/raspberry-pi-64.tmpl75
-rw-r--r--gnu/system/examples/vm-image.tmpl1
-rw-r--r--gnu/system/examples/yggdrasil.tmpl60
10 files changed, 156 insertions, 60 deletions
diff --git a/gnu/system/examples/asus-c201.tmpl b/gnu/system/examples/asus-c201.tmpl
index 6b6aa706fa..019111c167 100644
--- a/gnu/system/examples/asus-c201.tmpl
+++ b/gnu/system/examples/asus-c201.tmpl
@@ -1,3 +1,4 @@
+;; -*- mode: scheme; -*-
 ;; This is an operating system configuration template
 ;; for a "bare bones" setup for an ASUS C201PA.
 
diff --git a/gnu/system/examples/bare-bones.tmpl b/gnu/system/examples/bare-bones.tmpl
index 387e4b12ba..45b4995574 100644
--- a/gnu/system/examples/bare-bones.tmpl
+++ b/gnu/system/examples/bare-bones.tmpl
@@ -1,3 +1,4 @@
+;; -*- mode: scheme; -*-
 ;; This is an operating system configuration template
 ;; for a "bare bones" setup, with no X11 display server.
 
@@ -16,6 +17,9 @@
   (bootloader (bootloader-configuration
                 (bootloader grub-bootloader)
                 (targets '("/dev/sdX"))))
+  ;; It's fitting to support the equally bare bones ‘-nographic’
+  ;; QEMU option, which also nicely sidesteps forcing QWERTY.
+  (kernel-arguments (list "console=ttyS0,115200"))
   (file-systems (cons (file-system
                         (device (file-system-label "my-root"))
                         (mount-point "/")
diff --git a/gnu/system/examples/beaglebone-black.tmpl b/gnu/system/examples/beaglebone-black.tmpl
index 90dab62062..40d0a76a37 100644
--- a/gnu/system/examples/beaglebone-black.tmpl
+++ b/gnu/system/examples/beaglebone-black.tmpl
@@ -1,3 +1,4 @@
+;; -*- mode: scheme; -*-
 ;; This is an operating system configuration template
 ;; for a "bare bones" setup on BeagleBone Black board.
 
diff --git a/gnu/system/examples/desktop.tmpl b/gnu/system/examples/desktop.tmpl
index 7055a8f92d..10d0e54fa7 100644
--- a/gnu/system/examples/desktop.tmpl
+++ b/gnu/system/examples/desktop.tmpl
@@ -1,3 +1,4 @@
+;; -*- mode: scheme; -*-
 ;; This is an operating system configuration template
 ;; for a "desktop" setup with GNOME and Xfce where the
 ;; root partition is encrypted with LUKS, and a swap file.
diff --git a/gnu/system/examples/docker-image.tmpl b/gnu/system/examples/docker-image.tmpl
index bdc6afa6f0..7123917af4 100644
--- a/gnu/system/examples/docker-image.tmpl
+++ b/gnu/system/examples/docker-image.tmpl
@@ -1,3 +1,4 @@
+;; -*- mode: scheme; -*-
 ;; This is an operating system configuration template for a "Docker image"
 ;; setup, so it has barely any services at all.
 
diff --git a/gnu/system/examples/lightweight-desktop.tmpl b/gnu/system/examples/lightweight-desktop.tmpl
index d4330ecc8e..4cb3c38311 100644
--- a/gnu/system/examples/lightweight-desktop.tmpl
+++ b/gnu/system/examples/lightweight-desktop.tmpl
@@ -1,3 +1,4 @@
+;; -*- mode: scheme; -*-
 ;; This is an operating system configuration template
 ;; for a "desktop" setup without full-blown desktop
 ;; environments.
diff --git a/gnu/system/examples/raspberry-pi-64-nfs-root.tmpl b/gnu/system/examples/raspberry-pi-64-nfs-root.tmpl
new file mode 100644
index 0000000000..2203375270
--- /dev/null
+++ b/gnu/system/examples/raspberry-pi-64-nfs-root.tmpl
@@ -0,0 +1,71 @@
+;; -*- mode: scheme; -*-
+;; This is an operating-system configuration template of a
+;; 64-bit minimal system for a Raspberry Pi with an NFS root file-system.
+
+;; It neither installs firmware nor device-tree files for the Raspberry Pi.
+;; It just assumes them to be existing in boot/efi in the same way that some
+;; UEFI firmware with ACPI data is usually assumed to be existing on PCs.
+
+;; It expects the boot/efi directory to be served via TFTP and the root
+;; file-system to be served via NFS. See the grub-efi-netboot-bootloader
+;; description in the manual for more details.
+
+(use-modules (gnu)
+             (gnu artwork)
+             (gnu system nss))
+(use-service-modules admin
+                     avahi
+                     networking
+                     ssh)
+(use-package-modules certs
+                     linux
+                     raspberry-pi
+                     ssh)
+
+(define-public raspberry-pi-64-nfs-root
+  (operating-system
+    (host-name "raspberrypi-guix")
+    (timezone "Europe/Berlin")
+    (bootloader (bootloader-configuration
+                 (bootloader grub-efi-bootloader-chain-raspi-64)
+                 (targets (list "/boot/efi"))
+                 (theme (grub-theme
+                         (resolution '(1920 . 1080))
+                         (image (file-append
+                                 %artwork-repository
+                                 "/grub/GuixSD-fully-black-16-9.svg"))))))
+    (kernel-arguments '("ip=dhcp"))
+    (kernel (customize-linux #:linux linux-libre-arm64-generic
+                             #:extra-version "arm64-generic-netboot"
+                             #:configs '("CONFIG_NFS_SWAP=y"
+                                         "CONFIG_USB_USBNET=y"
+                                         "CONFIG_USB_LAN78XX=y"
+                                         "CONFIG_USB_NET_SMSC95XX=y")))
+    (initrd-modules '())
+    (file-systems (cons* (file-system
+                           (mount-point "/")
+                           (type "nfs")
+                           (device ":/export/raspberrypi/guix")
+                           (options "addr=10.20.30.40,vers=4.1"))
+                         %base-file-systems))
+    (swap-devices (list (swap-space
+                         (target "/run/swapfile"))))
+    (users (cons* (user-account
+                   (name "pi")
+                   (group "users")
+                   (supplementary-groups '("wheel" "netdev" "audio" "video"))
+                   (home-directory "/home/pi"))
+                  %base-user-accounts))
+    (packages (cons* nss-certs
+                     openssh
+                     %base-packages))
+    (services (cons* (service avahi-service-type)
+                     (service dhcp-client-service-type)
+                     (service ntp-service-type)
+                     (service openssh-service-type
+                              (openssh-configuration
+                               (x11-forwarding? #t)))
+                     %base-services))
+    (name-service-switch %mdns-host-lookup-nss)))
+
+raspberry-pi-64-nfs-root
diff --git a/gnu/system/examples/raspberry-pi-64.tmpl b/gnu/system/examples/raspberry-pi-64.tmpl
new file mode 100644
index 0000000000..185d25c412
--- /dev/null
+++ b/gnu/system/examples/raspberry-pi-64.tmpl
@@ -0,0 +1,75 @@
+;; -*- mode: scheme; -*-
+;; This is an operating-system configuration template of a
+;; 64-bit minimal system for a Raspberry Pi with local storage.
+
+;; It neither installs firmware nor device-tree files for the Raspberry Pi.
+;; It just assumes them to be existing in boot/efi in the same way that some
+;; UEFI firmware with ACPI data is usually assumed to be existing on PCs.
+
+;; It expects the boot-partition to be mounted as boot/efi in the same way
+;; as it is usually expeted on PCs with UEFI firmware.
+
+(use-modules (gnu)
+             (gnu artwork)
+             (gnu system nss))
+(use-service-modules admin
+                     avahi
+                     networking
+                     ssh)
+(use-package-modules certs
+                     linux
+                     raspberry-pi
+                     ssh)
+
+(define-public raspberry-pi-64
+  (operating-system
+    (host-name "raspberrypi-guix")
+    (timezone "Europe/Berlin")
+    (bootloader (bootloader-configuration
+                 (bootloader grub-efi-bootloader-chain-raspi-64)
+                 (targets (list "/boot/efi"))
+                 (theme (grub-theme
+                         (resolution '(1920 . 1080))
+                         (image (file-append
+                                 %artwork-repository
+                                 "/grub/GuixSD-fully-black-16-9.svg"))))))
+    (kernel (customize-linux #:linux linux-libre-arm64-generic
+                             ;; It is possible to use a specific defconfig
+                             ;; file, for example the "bcmrpi3_defconfig" with
+                             ;; the variable shown below.  Unfortunately the
+                             ;; kernel built from the linux-libre sources with
+                             ;; this defconfig file does not boot.
+                             ;;#:extra-version "gnu-bcmrpi3"
+                             ;;#:defconfig %bcmrpi3-defconfig
+                             ))
+    (initrd-modules '())
+    (file-systems (cons* (file-system
+                           (mount-point "/")
+                           (type "ext4")
+                           (device (file-system-label "Guix")))
+                         (file-system
+                           (mount-point "/boot/efi")
+                           (type "vfat")
+                           (device (file-system-label "EFI")))
+                         %base-file-systems))
+    (swap-devices (list (swap-space
+                         (target "/run/swapfile"))))
+    (users (cons* (user-account
+                   (name "pi")
+                   (group "users")
+                   (supplementary-groups '("wheel" "netdev" "audio" "video"))
+                   (home-directory "/home/pi"))
+                  %base-user-accounts))
+    (packages (cons* nss-certs
+                     openssh
+                     %base-packages))
+    (services (cons* (service avahi-service-type)
+                     (service dhcp-client-service-type)
+                     (service ntp-service-type)
+                     (service openssh-service-type
+                              (openssh-configuration
+                               (x11-forwarding? #t)))
+                     %base-services))
+    (name-service-switch %mdns-host-lookup-nss)))
+
+raspberry-pi-64
diff --git a/gnu/system/examples/vm-image.tmpl b/gnu/system/examples/vm-image.tmpl
index d46a27978c..343287eaf6 100644
--- a/gnu/system/examples/vm-image.tmpl
+++ b/gnu/system/examples/vm-image.tmpl
@@ -1,3 +1,4 @@
+;; -*- mode: scheme; -*-
 ;; This is an operating system configuration for a VM image.
 ;; Modify it as you see fit and instantiate the changes by running:
 ;;
diff --git a/gnu/system/examples/yggdrasil.tmpl b/gnu/system/examples/yggdrasil.tmpl
deleted file mode 100644
index 4d34f49b54..0000000000
--- a/gnu/system/examples/yggdrasil.tmpl
+++ /dev/null
@@ -1,60 +0,0 @@
-;; This is an operating system configuration template
-;; for a "bare bones" setup, with no X11 display server.
-
-(use-modules (gnu))
-(use-service-modules networking ssh)
-(use-package-modules admin curl networking screen)
-
-(operating-system
-  (host-name "ruby-guard-5545")
-  (timezone "Europe/Budapest")
-  (locale "en_US.utf8")
-
-  ;; Boot in "legacy" BIOS mode, assuming /dev/sdX is the
-  ;; target hard disk, and "my-root" is the label of the target
-  ;; root file system.
-  (bootloader (bootloader-configuration
-                (bootloader grub-bootloader)
-                (targets '("/dev/sdX"))))
-  (file-systems (cons (file-system
-                        (device (file-system-label "my-root"))
-                        (mount-point "/")
-                        (type "ext4"))
-                      %base-file-systems))
-  (users (cons (user-account
-                (name "alice")
-                (comment "Bob's sister")
-                (group "users")
-                ;; adding her to the yggdrasil group means she can use
-                ;; yggdrasilctl to modify the configuration
-                (supplementary-groups '("wheel" "yggdrasil")))
-               %base-user-accounts))
-
-  ;; Globally-installed packages.
-  (packages (cons* screen curl %base-packages))
-
-  ;; Add services to the baseline: a DHCP client and
-  ;; an SSH server.
-  ;; If you add an /etc/yggdrasil-private.conf, you can log in to ssh
-  ;; using your Yggdrasil IPv6 address from another machine running Yggdrasil.
-  ;; Alternatively, the client can sit behind a router that has Yggdrasil.
-  ;; That file is specifically _not_ handled by Guix, because we don't want its
-  ;; contents to sit in the world-readable /gnu/store.
-  (services
-   (append
-    (list
-     (service dhcp-client-service-type)
-     (service yggdrasil-service-type
-              (yggdrasil-configuration
-               (log-to 'stdout)
-               (log-level 'debug)
-               (autoconf? #f)
-               (json-config
-                ;; choose a few from
-                ;; https://github.com/yggdrasil-network/public-peers
-                '((peers . #("tcp://1.2.3.4:1337"))))
-               (config-file #f)))
-     (service openssh-service-type
-              (openssh-configuration
-               (port-number 2222))))
-    %base-services)))