desktop.tmpl 3.9 KB

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