guix-packages/linux-custom: Setup

master
Pierre Neidhardt 2018-09-19 19:57:15 +02:00
parent 3161450b3c
commit 1bc0104b7a
2 changed files with 165 additions and 48 deletions

View File

@ -2,6 +2,9 @@
;; for a "desktop" setup without full-blown desktop
;; environments.
;; With Eshell:
;; *sudo -E guix system reconfigure ~/.guix-config/config.scm
(use-modules (gnu)
(gnu packages linux)
(gnu packages tls)
@ -30,53 +33,92 @@
(use-package-modules bootloaders certs suckless ;; xorg
)
(define-public linux-nonfree
(package
(inherit linux-libre)
(name "linux-nonfree")
(version (package-version linux-libre-4.14))
(source
(origin
(method url-fetch)
(uri
(string-append
"https://www.kernel.org/pub/linux/kernel/v4.x/"
"linux-" version ".tar.xz"))
(sha256
(base32
;; "0c88p5vly63jsz62ff7971zl6vqzzbv5q519gi8z17ld66sf5063" ; 4.14.33
;; "0jwa2r3gpn4ahy38730b7g4xzavfqwxxwgyfhpn5ssvzsc4934gs" ; 4.16.6
"1w0r7g04q9ac14krm5dmvl8sv88avsmdirvnfk964cz3n3xxbgb1" ; 4.14.69
))))))
;; (define-public linux-nonfree
;; (package
;; (inherit linux-libre)
;; (name "linux-nonfree")
;; (version (package-version linux-libre-4.14))
;; (source
;; (origin
;; (method url-fetch)
;; (uri
;; (string-append
;; "https://www.kernel.org/pub/linux/kernel/v4.x/"
;; "linux-" version ".tar.xz"))
;; (sha256
;; (base32
;; ;; "0c88p5vly63jsz62ff7971zl6vqzzbv5q519gi8z17ld66sf5063" ; 4.14.33
;; ;; "0jwa2r3gpn4ahy38730b7g4xzavfqwxxwgyfhpn5ssvzsc4934gs" ; 4.16.6
;; "1w0r7g04q9ac14krm5dmvl8sv88avsmdirvnfk964cz3n3xxbgb1" ; 4.14.69
;; ))))))
(define-public linux-nonfree-firmware
(let ((version "0.0.0")
(commit "6d5131107f2ba67a13f469ac770a55f101ba654d"))
(package
(name "linux-nonfree-firmware")
(version version)
(source (origin
(method git-fetch)
(uri (git-reference
(url "git://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git")
(commit commit)))
(sha256
(base32
"0nql7rqkx064lsw5bh6n29yfdxmp3hl4nqgp1fxdb4ys76awchg3"))))
(build-system trivial-build-system)
(arguments
`(#:modules ((guix build utils))
#:builder (begin
(use-modules (guix build utils))
(let ((source (assoc-ref %build-inputs "source"))
(destination (string-append %output "/lib/firmware")))
(mkdir-p destination)
(copy-recursively source destination #:follow-symlinks? #t)
#t))))
(home-page "")
(synopsis "Non-free firmware for the Linux kernel")
(description "Non-free firmware for the Linux kernel")
(license #f))))
;; All linux-nonfree-firmware.
;; (define-public linux-nonfree-firmware
;; (let ((version "0.0.0")
;; (commit "6d5131107f2ba67a13f469ac770a55f101ba654d"))
;; (package
;; (name "linux-nonfree-firmware")
;; (version version)
;; (source (origin
;; (method git-fetch)
;; (uri (git-reference
;; (url "git://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git")
;; (commit commit)))
;; (sha256
;; (base32
;; "0nql7rqkx064lsw5bh6n29yfdxmp3hl4nqgp1fxdb4ys76awchg3"))))
;; (build-system trivial-build-system)
;; (arguments
;; `(#:modules ((guix build utils))
;; #:builder (begin
;; (use-modules (guix build utils))
;; (let ((source (assoc-ref %build-inputs "source"))
;; (destination (string-append %output "/lib/firmware")))
;; (mkdir-p destination)
;; (copy-recursively source destination #:follow-symlinks? #t)
;; #t))))
;; (home-page "")
;; (synopsis "Non-free firmware for the Linux kernel")
;; (description "Non-free firmware for the Linux kernel")
;; (license #f))))
;; (define (linux-firmware-version) "9d40a17beaf271e6ad47a5e714a296100eef4692")
;; (define (linux-firmware-source version)
;; (origin
;; (method git-fetch)
;; (uri (git-reference
;; (url (string-append "https://git.kernel.org/pub/scm/linux/kernel"
;; "/git/firmware/linux-firmware.git"))
;; (commit version)))
;; (file-name (string-append "linux-firmware-" version "-checkout"))
;; (sha256
;; (base32
;; "099kll2n1zvps5qawnbm6c75khgn81j8ns0widiw0lnwm8s9q6ch"))))
;; (define-public iwlwifi-firmware-nonfree
;; (package
;; (name "iwlwifi-firmware-nonfree")
;; (version (linux-firmware-version))
;; (source (linux-firmware-source version))
;; (build-system trivial-build-system)
;; (arguments
;; `(#:modules ((guix build utils))
;; #:builder (begin
;; (use-modules (guix build utils))
;; (let ((source (assoc-ref %build-inputs "source"))
;; (fw-dir (string-append %output "/lib/firmware/")))
;; (mkdir-p fw-dir)
;; (for-each (lambda (file)
;; (copy-file file
;; (string-append fw-dir (basename file))))
;; (find-files source
;; "iwlwifi-.*\\.ucode$|LICENSE\\.iwlwifi_firmware$"))
;; #t))))
;; (home-page "https://wireless.wiki.kernel.org/en/users/drivers/iwlwifi")
;; (synopsis "Non-free firmware for Intel wifi chips")
;; (description "Non-free iwlwifi firmware")
;; (license (license:non-copyleft
;; "https://git.kernel.org/cgit/linux/kernel/git/firmware/linux-firmware.git/tree/LICENCE.iwlwifi_firmware?id=HEAD"))))
;; Allow members of the "video" group to change the screen brightness.
(define %backlight-udev-rule
@ -157,7 +199,10 @@
;; (kernel-arguments '("modprobe.blacklist=pcspkr"))
;; (kernel-arguments '("modprobe.blacklist=nouveau"))
;; (kernel-arguments '("pcie_port_pm=off"))
(firmware (cons* linux-nonfree-firmware %base-firmware))
;; (firmware (cons* linux-nonfree-firmware %base-firmware))
(firmware (append (list
linux-firmware-iwlwifi)
%base-firmware))
;; REVIEW: shpchp seems to be obsolete.
;; (initrd-modules (append (list "shpchp")

View File

@ -2,6 +2,9 @@
#:use-module (guix gexp)
#:use-module (guix packages)
#:use-module (guix download)
#:use-module (guix git-download)
#:use-module (guix build-system trivial)
#:use-module ((guix licenses) #:prefix license:)
#:use-module (gnu packages linux)
#:use-module (srfi srfi-1))
@ -32,5 +35,74 @@
"1w0r7g04q9ac14krm5dmvl8sv88avsmdirvnfk964cz3n3xxbgb1" ; 4.14.69
))))
(native-inputs
`(("kconfig" ,(local-file "./linux-custom.conf"))
`(("kconfig" ,(local-file "./linux-manual.conf"))
,@(alist-delete "kconfig" (package-native-inputs linux-libre))))))
;; 250+ MB.
(define-public linux-firmware-all
(let ((version "0.0.0")
(commit "6d5131107f2ba67a13f469ac770a55f101ba654d"))
(package
(name "linux-firmware-all")
(version version)
(source (origin
(method git-fetch)
(uri (git-reference
(url "git://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git")
(commit commit)))
(sha256
(base32
"0nql7rqkx064lsw5bh6n29yfdxmp3hl4nqgp1fxdb4ys76awchg3"))))
(build-system trivial-build-system)
(arguments
`(#:modules ((guix build utils))
#:builder (begin
(use-modules (guix build utils))
(let ((source (assoc-ref %build-inputs "source"))
(destination (string-append %output "/lib/firmware")))
(mkdir-p destination)
(copy-recursively source destination #:follow-symlinks? #t)
#t))))
(home-page "")
(synopsis "Non-free firmware for the Linux kernel")
(description "Non-free firmware for the Linux kernel")
(license #f))))
(define (linux-firmware-version) "9d40a17beaf271e6ad47a5e714a296100eef4692")
(define (linux-firmware-source version)
(origin
(method git-fetch)
(uri (git-reference
(url (string-append "https://git.kernel.org/pub/scm/linux/kernel"
"/git/firmware/linux-firmware.git"))
(commit version)))
(file-name (string-append "linux-firmware-" version "-checkout"))
(sha256
(base32
"099kll2n1zvps5qawnbm6c75khgn81j8ns0widiw0lnwm8s9q6ch"))))
;; ~60 MB.
(define-public linux-firmware-iwlwifi
(package
(name "linux-firmware-iwlwifi")
(version (linux-firmware-version))
(source (linux-firmware-source version))
(build-system trivial-build-system)
(arguments
`(#:modules ((guix build utils))
#:builder (begin
(use-modules (guix build utils))
(let ((source (assoc-ref %build-inputs "source"))
(fw-dir (string-append %output "/lib/firmware/")))
(mkdir-p fw-dir)
(for-each (lambda (file)
(copy-file file
(string-append fw-dir (basename file))))
(find-files source
"iwlwifi-.*\\.ucode$|LICENSE\\.iwlwifi_firmware$"))
#t))))
(home-page "https://wireless.wiki.kernel.org/en/users/drivers/iwlwifi")
(synopsis "Non-free firmware for Intel wifi chips")
(description "Non-free iwlwifi firmware")
(license (license:non-copyleft
"https://git.kernel.org/cgit/linux/kernel/git/firmware/linux-firmware.git/tree/LICENCE.iwlwifi_firmware?id=HEAD"))))