os-32-to-64.scm 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. ;; This is a simple example of an operating system declaration to move
  2. ;; from a 32-bit system to a 64-bit one. See the thread
  3. ;; <http://lists.gnu.org/archive/html/guix-devel/2015-05/msg00392.html>
  4. ;; for details.
  5. (use-modules
  6. (gnu)
  7. (guix monads)
  8. (guix store)
  9. ((guix build utils) #:select (alist-replace))
  10. (guix packages)
  11. (gnu packages linux)
  12. (gnu packages package-management)
  13. (gnu services base)
  14. (al guix services linux))
  15. (define linux-libre-x86_64
  16. (package
  17. (inherit linux-libre)
  18. (arguments `(#:system "x86_64-linux"
  19. ,@(package-arguments linux-libre)))
  20. (native-inputs
  21. (alist-replace
  22. "kconfig"
  23. (list (string-append
  24. (getenv "HOME")
  25. "/src/guix/gnu/packages/linux-libre-x86_64.conf"))
  26. (package-native-inputs linux-libre)))))
  27. (define guix-x86_64
  28. (package
  29. (inherit guix)
  30. (arguments `(#:system "x86_64-linux"
  31. ,@(package-arguments guix)))))
  32. (define %services
  33. ;; Make sure guix-service uses 'guix-x86_64' package.
  34. (map (lambda (service)
  35. (if (eqv? 'guix (service-type-name (service-kind service)))
  36. (service guix-service-type
  37. (guix-configuration (guix guix-x86_64)))
  38. service))
  39. %base-services))
  40. (operating-system
  41. (host-name "host")
  42. (timezone "Europe/Moscow")
  43. (kernel linux-libre-x86_64)
  44. (bootloader (bootloader-configuration
  45. (bootloader grub-bootloader)
  46. (target "/dev/sda")))
  47. (file-systems
  48. (cons* (file-system
  49. (device (file-system-label "guix"))
  50. (mount-point "/")
  51. (type "ext4"))
  52. %base-file-systems))
  53. (users
  54. (list (user-account
  55. (name "al")
  56. (uid 1000)
  57. (home-directory "/home/al")
  58. (group "users")
  59. (supplementary-groups
  60. '("wheel" "audio" "video")))))
  61. (packages
  62. (cons* iproute
  63. %base-packages))
  64. (services
  65. (cons* (service loadkeys-service-type "dvorak")
  66. %services)))