Subject: Re: bug#24993: System installer grows brittle with time

From: David Craven <[email-masked]>
Date: Tue, 29 Nov 2016 10:17:38 +0100

I have a nice one too. How to run guixsd on any hardware :)

(use-modules (gnu)
             (gnu system nss)
             (guix build-system trivial)
             (guix download)
             (guix git-download)
             (guix packages))
(use-service-modules base networking)
(use-package-modules certs linux)

(define-public linux-firmware
  (let ((commit "21e216f591bed97ec1adcda0e8b4b28ddf065433"))
    (package
      (name "linux-firmware")
      (version (string-append "2016.11.27-" (string-take commit 7)))
      (source (origin
                (method git-fetch)
                (uri (git-reference
                        (url (string-append
                              "https://github.com/wkennington/linux-firmware"))
                        (commit commit)))
                (sha256
                 (base32
                  "0iiayy00zr3fk8xfi8i9vrbpg7r59n5vfzx9x7cpx6gjaja8czxa"))))
      (build-system trivial-build-system)
      (arguments
       `(#:modules ((guix build utils))
         #:builder
         (begin
           (use-modules (guix build utils))

           (let* ((source   (assoc-ref %build-inputs "source"))
                  (out      (assoc-ref %outputs "out"))
                  (firmware (string-append out "/lib/firmware")))
             (mkdir-p firmware)
             (copy-recursively source firmware)))))
      (home-page "https://github.com/wkennington/linux-firmware")
      (synopsis "Linux firmware")
      (description "Linux firmware.")
      (license #f))))

(define-public linux
  (package
    (inherit linux-libre)
    (version "4.8.11")
    (source (origin
              (method url-fetch)
              (uri (string-append
                    "https://cdn.kernel.org/pub/linux/kernel/v4.x/"
                    "linux-" version ".tar.xz"))
              (sha256
               (base32
                "03w90vfjfcya38mcp1njasa5c67za203sgp9n3w52gms13s443yc"))))))

(operating-system
  (host-name "system76")
  (timezone "Europe/Zurich")
  (locale "en_US.UTF-8")

  (kernel linux)
  (firmware (list linux-firmware))

  (bootloader (grub-configuration (device "/dev/sda")))

  (file-systems (cons (file-system
                        (device "my-root")
                        (title 'label)
                        (mount-point "/")
                        (type "ext4"))
                      %base-file-systems))

  (users (cons (user-account
                (name "dvc")
                (comment "David Craven")
                (group "users")
                (supplementary-groups '("wheel" "netdev"
                                        "audio" "video"))
                (home-directory "/home/dvc"))
               %base-user-accounts))

  (packages (cons* nss-certs
                   %base-packages))

  (services (cons* (dhcp-client-service)
                   %base-services))

  ;; Allow resolution of '.local' host names with mDNS.
  (name-service-switch %mdns-host-lookup-nss))