| 1 | ;; -*- mode: scheme; -*-
|
| 2 | ;; This is an operating system configuration template
|
| 3 | ;; for a "desktop" setup with GNOME and Xfce where the
|
| 4 | ;; root partition is encrypted with LUKS, and a swap file.
|
| 5 |
|
| 6 | (use-modules (gnu) (gnu system nss) (guix utils)
|
| 7 | (guix packages))
|
| 8 | (use-service-modules desktop sddm xorg)
|
| 9 | (use-package-modules gnome)
|
| 10 |
|
| 11 | (operating-system
|
| 12 | (host-name "antelope")
|
| 13 | (timezone "Europe/Paris")
|
| 14 | (locale "en_US.utf8")
|
| 15 |
|
| 16 | ;; Choose US English keyboard layout. The "altgr-intl"
|
| 17 | ;; variant provides dead keys for accented characters.
|
| 18 | (keyboard-layout (keyboard-layout "us" "altgr-intl"))
|
| 19 |
|
| 20 | ;; Use the UEFI variant of GRUB with the EFI System
|
| 21 | ;; Partition mounted on /boot/efi.
|
| 22 | (bootloader (bootloader-configuration
|
| 23 | (bootloader grub-efi-bootloader)
|
| 24 | (targets '("/boot/efi"))
|
| 25 | (keyboard-layout keyboard-layout)))
|
| 26 |
|
| 27 | ;; Specify a mapped device for the encrypted root partition.
|
| 28 | ;; The UUID is that returned by 'cryptsetup luksUUID'.
|
| 29 | (mapped-devices
|
| 30 | (list (mapped-device
|
| 31 | (source (uuid "12345678-1234-1234-1234-123456789abc"))
|
| 32 | (target "my-root")
|
| 33 | (type luks-device-mapping))))
|
| 34 |
|
| 35 | (file-systems (append
|
| 36 | (list (file-system
|
| 37 | (device (file-system-label "my-root"))
|
| 38 | (mount-point "/")
|
| 39 | (type "ext4")
|
| 40 | (dependencies mapped-devices))
|
| 41 | (file-system
|
| 42 | (device (uuid "1234-ABCD" 'fat))
|
| 43 | (mount-point "/boot/efi")
|
| 44 | (type "vfat")))
|
| 45 | %base-file-systems))
|
| 46 |
|
| 47 | ;; Specify a swap file for the system, which resides on the
|
| 48 | ;; root file system.
|
| 49 | (swap-devices (list (swap-space
|
| 50 | (target "/swapfile"))))
|
| 51 |
|
| 52 | ;; Create user `bob' with `alice' as its initial password.
|
| 53 | (users (cons (user-account
|
| 54 | (name "bob")
|
| 55 | (comment "Alice's brother")
|
| 56 | (password (crypt "alice" "$6$abc"))
|
| 57 | (group "students")
|
| 58 | (supplementary-groups '("wheel" "netdev"
|
| 59 | "audio" "video")))
|
| 60 | %base-user-accounts))
|
| 61 |
|
| 62 | ;; Add the `students' group
|
| 63 | (groups (cons* (user-group
|
| 64 | (name "students"))
|
| 65 | %base-groups))
|
| 66 |
|
| 67 | ;; This is where we specify system-wide packages.
|
| 68 | (packages (append (list
|
| 69 | ;; for user mounts
|
| 70 | gvfs)
|
| 71 | %base-packages))
|
| 72 |
|
| 73 | ;; Add GNOME and Xfce---we can choose at the log-in screen
|
| 74 | ;; by clicking the gear. Use the "desktop" services, which
|
| 75 | ;; include the X11 log-in service, networking with
|
| 76 | ;; NetworkManager, and more.
|
| 77 | (services (if (supported-package? gnome
|
| 78 | (or (and=> (%current-target-system)
|
| 79 | gnu-triplet->nix-system)
|
| 80 | (%current-system)))
|
| 81 | (append (list (service gnome-desktop-service-type)
|
| 82 | (service xfce-desktop-service-type)
|
| 83 | (set-xorg-configuration
|
| 84 | (xorg-configuration
|
| 85 | (keyboard-layout keyboard-layout))))
|
| 86 | %desktop-services)
|
| 87 |
|
| 88 | ;; FIXME: Since Gnome depends on Rust and Rust is currently
|
| 89 | ;; unavailable on some platforms, we use MATE here instead of
|
| 90 | ;; GNOME.
|
| 91 | (append (list (service mate-desktop-service-type)
|
| 92 | (service xfce-desktop-service-type)
|
| 93 | (set-xorg-configuration
|
| 94 | (xorg-configuration
|
| 95 | (keyboard-layout keyboard-layout))))
|
| 96 | %desktop-services)))
|
| 97 |
|
| 98 | ;; Allow resolution of '.local' host names with mDNS.
|
| 99 | (name-service-switch %mdns-host-lookup-nss))
|