desktop.tmpl 3.8 KB

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