diff options
-rw-r--r-- | README.org | 69 | ||||
-rw-r--r-- | news.txt | 10 | ||||
-rw-r--r-- | nongnu/packages/cad.scm | 2 | ||||
-rw-r--r-- | nongnu/packages/chrome.scm | 6 | ||||
-rw-r--r-- | nongnu/packages/coq.scm | 6 | ||||
-rw-r--r-- | nongnu/packages/editors.scm | 35 | ||||
-rw-r--r-- | nongnu/packages/game-development.scm | 197 | ||||
-rw-r--r-- | nongnu/packages/linux.scm | 170 | ||||
-rw-r--r-- | nongnu/packages/messaging.scm | 8 | ||||
-rw-r--r-- | nongnu/packages/mozilla.scm | 12 | ||||
-rw-r--r-- | nongnu/packages/nvidia.scm | 1042 | ||||
-rw-r--r-- | nongnu/packages/productivity.scm | 8 | ||||
-rw-r--r-- | nongnu/packages/video.scm | 74 | ||||
-rw-r--r-- | nongnu/packages/vpn.scm | 11 | ||||
-rw-r--r-- | nongnu/services/nvidia.scm | 58 | ||||
-rw-r--r-- | nongnu/system/install.scm | 43 | ||||
-rw-r--r-- | nonguix/build/chromium-binary-build-system.scm | 5 | ||||
-rw-r--r-- | nonguix/build/utils.scm | 20 |
18 files changed, 1124 insertions, 652 deletions
@@ -220,6 +220,75 @@ firmware, and blacklisting of conflicting modules: ...)) ...) #+END_SRC + +** NVIDIA graphics card + +NVIDIA graphics card support in Nonguix consists of a system service =nvidia-service-type= and a package =nvda= for application setup. + +The following code serves as an example for system setup: + +#+BEGIN_SRC scheme + (use-modules (gnu services gnome) + (gnu services xorg) + (nongnu packages nvidia) + (nongnu services nvidia)) + + (operating-system + (kernel-arguments '("modprobe.blacklist=nouveau" + ;; Set this if the card is not used for displaying or + ;; you're using Wayland: + "nvidia_drm.modeset=1")) + (services + (cons* (service nvidia-service-type) + ;; Configure desktop environment, GNOME for example. + (service gnome-desktop-service-type + ;; Enable NVIDIA support, only do this when the card is + ;; used for displaying. + (gnome-desktop-configuration + (gnome (replace-mesa gnome)))) + ;; Configure Xorg server, only do this when the card is used for + ;; displaying. + (set-xorg-configuration + (xorg-configuration + (modules (cons nvda %default-xorg-modules)) + (drivers '("nvidia")))) + ...)) + ...) +#+END_SRC + +For application setup, =mesa= has to be replaced with =nvda= for every individual package that requires the NVIDIA driver, this can be done with grafting (which doesn't rebuild packages) or rewriting inputs (which rebuilds packages) (see [[https://guix.gnu.org/manual/devel/en/guix.html#Package-Transformation-Options][Package Transformation Options]] in GNU Guix Reference Manual). For example: + +#+BEGIN_SRC shell + guix build mesa-utils --with-graft=mesa=nvda + guix build mesa-utils --with-input=mesa=nvda +#+END_SRC + +The above transformation can be used within an one-off software environment spawned by =guix shell= as well, for correct environment variables, the =nvda= package may be added into the environment: + +#+BEGIN_SRC shell + guix shell mesa-utils nvda --with-graft=mesa=nvda \ + -- glxinfo +#+END_SRC + +To graft mesa with nvda programmatically, use =replace-mesa= defined in =(nongnu packages nvidia)=: + +#+BEGIN_SRC scheme + (use-modules (nongnu packages nvidia)) + + ;; Replace mesa with nvda for a single package. + (replace-mesa <some-package>) + + ;; Replace mesa with nvda for a package list. + (map replace-mesa (list <some-package> ...)) + + ;; A package with mesa replaced is still a package, it can be part of a + ;; package list. + (list (replace-mesa <some-package>) + ...) +#+END_SRC + +When the card is not used for displaying, environment variables =__GLX_VENDOR_LIBRARY_NAME=nvidia= and =__NV_PRIME_RENDER_OFFLOAD=1= may be set. + ** Substitutes for nonguix A Nonguix substitute server is available at [[https://substitutes.nonguix.org]]. @@ -9,6 +9,16 @@ (channel-news (version 0) + (entry (commit "be61a1829a19724299e46d6e3c1038229039c3ee") + (title + (en "Nvidia driver package/service updates and changes")) + (body + (en "In addition to the Nvidia driver package being updated to 550.67, +the service, procedures, and configuration has changed. Please see the new +directions in the Nonguix README.org for how to use the Nvidia driver in your +system configuration, and of course report any issues with these changes or +improvements for the documentation."))) + (entry (commit "8078757b887a7691644b119913c3f7b41661775d") (title (en "New @code{GUIX_SANDBOX_EXTRA_SHARES} variable for nonguix containers (Steam)")) diff --git a/nongnu/packages/cad.scm b/nongnu/packages/cad.scm index c17bb35..a66bef3 100644 --- a/nongnu/packages/cad.scm +++ b/nongnu/packages/cad.scm @@ -146,7 +146,7 @@ openlibm pulseaudio qtbase-5 - qtserialport + qtserialport-5 qtmultimedia-5 zlib)) (synopsis "Layout, editing, and control software for your laser cutter") diff --git a/nongnu/packages/chrome.scm b/nongnu/packages/chrome.scm index 67a061b..d3bc509 100644 --- a/nongnu/packages/chrome.scm +++ b/nongnu/packages/chrome.scm @@ -143,10 +143,10 @@ (license (nonfree "https://www.google.com/intl/en/chrome/terms/"))))) (define-public google-chrome-stable - (make-google-chrome "stable" "121.0.6167.139" "1b08wqflp1j5yqpw2g9z2s239gs8bzqbxigcxk93aqwf5c21ijkh")) + (make-google-chrome "stable" "123.0.6312.86" "1fjpwz5pdzjak7932kxvmp3ba2s5qyvj5b908sndg9l4qv1hkh96")) (define-public google-chrome-beta - (make-google-chrome "beta" "122.0.6261.6" "1b12bjcg99f6bjfhm311hdx9s1a4i13mcgxbvf1gpzq8989c1g96")) + (make-google-chrome "beta" "124.0.6367.18" "18gv6s4v6g8nw80rfiamz0xx6bwzn567xvmmn95xx70lhcvz9s34")) (define-public google-chrome-unstable - (make-google-chrome "unstable" "123.0.6262.5" "04mf9nysdn77371fxa3z0wbvy2k09vw49s3lrcynlwgiwrz89a3m")) + (make-google-chrome "unstable" "125.0.6368.2" "0cfsq2qh9apbafapxqdz8sb65mm6yqxpcl7kwx9g9yi0sngqcxsz")) diff --git a/nongnu/packages/coq.scm b/nongnu/packages/coq.scm index e8c9137..6fcf7a7 100644 --- a/nongnu/packages/coq.scm +++ b/nongnu/packages/coq.scm @@ -15,7 +15,7 @@ (define-public compcert (package (name "compcert") - (version "3.12") + (version "3.13.1") (source (origin (method git-fetch) (uri (git-reference @@ -24,7 +24,7 @@ (file-name (git-file-name name version)) (sha256 (base32 - "0pcrkz1as37iz2wcp8j226fjn672lrj0cip2s0wpkiy097qi0yc5")))) + "0yvj9g144p26k7674vcai12sh3jahs64ny9pana9zla16nxxpmcm")))) (build-system gnu-build-system) (arguments `(#:phases @@ -32,7 +32,7 @@ (add-before 'configure 'allow-newer-coq-version (lambda _ (substitute* "configure" - (("8.15.2") "8.16.1")))) + (("8.15.2") "8.17.1")))) (replace 'configure (lambda* (#:key outputs #:allow-other-keys) (let ((system ,(match (or (%current-target-system) (%current-system)) diff --git a/nongnu/packages/editors.scm b/nongnu/packages/editors.scm index d07bf1d..114fe85 100644 --- a/nongnu/packages/editors.scm +++ b/nongnu/packages/editors.scm @@ -1,5 +1,5 @@ ;;; SPDX-License-Identifier: GPL-3.0-or-later -;;; Copyright © 2023 Giacomo Leidi <goodoldpaul@autistici.org> +;;; Copyright © 2023, 2024 Giacomo Leidi <goodoldpaul@autistici.org> (define-module (nongnu packages editors) #:use-module (gnu packages base) @@ -14,20 +14,27 @@ (define-public vscodium (package (name "vscodium") - (version "1.87.0.24060") + (version "1.88.1.24104") (source - (origin - (method url-fetch) - (uri - (let ((arch (match (or (%current-target-system) (%current-system)) - ("aarch64-linux" "arm64") - ("armhf-linux" "armhf") - (_ "x64")))) - (string-append - "https://github.com/VSCodium/vscodium/releases/download/" version - "/VSCodium-linux-" arch "-" version ".tar.gz"))) - (sha256 - (base32 "1lw7j8h0i96mg8si8dmi55ldbz5j63zb93qf1g59siavx84f1zpd")))) + (let ((arch (match (or (%current-target-system) (%current-system)) + ("aarch64-linux" "arm64") + ("armhf-linux" "armhf") + (_ "x64"))) + (hash (match (or (%current-target-system) (%current-system)) + ("aarch64-linux" + "0412222l9r81f3aa3zlzrg42hzslvvck5kds7zrmpssjrd41jxfh") + ("armhf-linux" + "1sblaigrxscx4l1kln1zxzm5da5lr50y1k6qb4igq6wxbdx55iay") + (_ + "1n3gb12asid2qwwzf9fj974ws9n7has9l23ni8jscx9cp63l5rbl")))) + (origin + (method url-fetch) + (uri + (string-append + "https://github.com/VSCodium/vscodium/releases/download/" version + "/VSCodium-linux-" arch "-" version ".tar.gz")) + (sha256 + (base32 hash))))) (build-system chromium-binary-build-system) (arguments (list #:validate-runpath? #f ; TODO: fails on wrapped binary and included other files diff --git a/nongnu/packages/game-development.scm b/nongnu/packages/game-development.scm index 566cea2..e23c4ca 100644 --- a/nongnu/packages/game-development.scm +++ b/nongnu/packages/game-development.scm @@ -1,16 +1,20 @@ ;;; SPDX-License-Identifier: GPL-3.0-or-later ;;; Copyright © 2019, 2020 Pierre Neidhardt <mail@ambrevar.xyz> ;;; Copyright © 2022 Attila Lendvai <attila@lendvai.name> +;;; Copyright © 2024 Timotej Lazar <timotej.lazar@araneo.si> (define-module (nongnu packages game-development) #:use-module (ice-9 match) + #:use-module (srfi srfi-1) #:use-module ((nonguix licenses) :prefix license:) #:use-module (guix packages) #:use-module (nonguix build-system binary) #:use-module (guix build-system gnu) #:use-module (guix download) + #:use-module (guix gexp) #:use-module (guix git-download) #:use-module (guix utils) + #:use-module ((guix licenses) :prefix license:) #:use-module (gnu packages audio) #:use-module (gnu packages base) #:use-module (gnu packages gcc) @@ -159,128 +163,95 @@ development should opt for GLSL rather than Cg.") "https://raw.githubusercontent.com/ValveSoftware/source-sdk-2013/master/LICENSE")))) (define-public eduke32 - ;; There are no official releases. - (let ((commit "188e14622cfe5c6f63b04b989b350bf2a29a893c") - (revision "1") - (duke-nukem-3d-directory "share/dukenukem3d")) - (package - (name "eduke32") - (version (git-version "0" revision commit)) - (source - (origin - (method git-fetch) - (uri (git-reference - (url "https://voidpoint.io/terminx/eduke32.git") - (commit commit))) - (file-name (git-file-name name version)) - (sha256 - (base32 "0wy4bppiw4q2hn0v38msrjyvj2hzfvigakc23c2wqfnbl7rm0hrz")) - ;; Unbundle libxmp. - (modules '((guix build utils))) - (snippet - '(begin (delete-file-recursively "source/libxmp-lite") #t)))) - (build-system gnu-build-system) - (arguments - `(#:tests? #f - ;; Add glu to rpath so that SDL can dlopen it. - #:make-flags (list (string-append "LDFLAGS=-Wl,-rpath=" - (assoc-ref %build-inputs "glu") "/lib")) - #:phases - (modify-phases %standard-phases - (add-after 'unpack 'unbundle-libxmp - (lambda _ - (substitute* "GNUmakefile" - (("-I\\$\\(libxmplite_inc\\)") - (string-append "-I" (assoc-ref %build-inputs "libxmp") "/include")) - (("^ *audiolib_deps \\+= libxmplite.*$") "") - (("-logg") "-logg -lxmp")) - (with-directory-excursion "source/audiolib/src" - (for-each (lambda (file) (substitute* file (("libxmp-lite/") ""))) - '("multivoc.cpp" "xmp.cpp"))) - #t)) - (delete 'configure) - (replace 'install - (lambda* (#:key inputs outputs #:allow-other-keys) - (let* ((out (assoc-ref outputs "out")) - (glu (assoc-ref inputs "glu")) - (eduke (string-append out "/bin/eduke32")) - (eduke-real (string-append out "/bin/.eduke32-real"))) - ;; TODO: Install custom .desktop file? Need icon. - ;; See https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=eduke32. - (install-file "eduke32" (string-append out "/bin")) - (install-file "mapster32" (string-append out "/bin")) - (install-file "package/common/buildlic.txt" - (string-append out "/share/licenses")) - ;; Wrap program: - ;; - Make sure current directory is writable, else eduke32 will segfault. - ;; - Add ../share/dukenukem3d to the dir search list. - ;; TODO: Skip store duke3d.grp When ~/.config/eduke32/duke3d.grp is found. - (rename-file eduke eduke-real) - (call-with-output-file eduke - (lambda (p) - (format p "\ -#!~a -mkdir -p ~~/.config/eduke32 -cd ~~/.config/eduke32 -exec -a \"$0\" ~a\ - -g \"${0%/*}\"/../~a/*.grp\ - -g \"${0%/*}\"/../~a/*.zip\ - -g \"${0%/*}\"/../~a/*.map\ - -g \"${0%/*}\"/../~a/*.con\ - -g \"${0%/*}\"/../~a/*.def\ - \"$@\"~%" - (which "bash") eduke-real - ,duke-nukem-3d-directory - ,duke-nukem-3d-directory - ,duke-nukem-3d-directory - ,duke-nukem-3d-directory - ,duke-nukem-3d-directory))) - (chmod eduke #o755))))))) - (native-inputs - `(("pkg-config" ,pkg-config))) - (inputs - `(("sdl-union" ,(sdl-union (list sdl2 sdl2-mixer))) - ("alsa-lib" ,alsa-lib) - ("glu" ,glu) - ("libvorbis" ,libvorbis) - ("libvpx" ,libvpx) - ("libxmp" ,libxmp) - ("flac" ,flac) - ("gtk+" ,gtk+-2))) - (synopsis "Engine of the classic PC first person shooter Duke Nukem 3D") - (description "EDuke32 is a free homebrew game engine and source port of the -classic PC first person shooter Duke Nukem 3D—Duke3D for short. A thousands -of features and upgrades were added for regular players and additional editing -capabilities and scripting extensions for homebrew developers and mod -creators. EDuke32 is open source but non-free software. + (package + (name "eduke32") + (version "20240316-10564-0bc78c53d") + (source + (origin + (method url-fetch) + (uri (string-append "https://dukeworld.com/eduke32/synthesis/" + version "/eduke32_src_" version ".tar.xz")) + (sha256 + (base32 "1a9fw1kfriyrybjxl72b2434w3yiz2nxg6541lnyhzbdka2cp2lf")) + (modules '((guix build utils))) + (snippet + ;; Remove bundled libxmp and platform-specific stuff. + #~(for-each delete-file-recursively '("platform" "source/libxmp-lite"))))) + (build-system gnu-build-system) + (arguments + (list #:license-file-regexp "buildlic.txt" + #:tests? #f + #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'link-license + (lambda _ + ;; Ensure the install-license-files phase can find it. + (link "package/common/buildlic.txt" "buildlic.txt"))) + (add-after 'unpack 'unbundle-libxmp + (lambda _ + (substitute* "Common.mak" + (("^LIBS :=" match) (string-append match " -lxmp"))) + (with-directory-excursion "source/audiolib/src" + (for-each (lambda (file) (substitute* file (("libxmp-lite/") ""))) + '("multivoc.cpp" "xmp.cpp"))))) + (add-after 'unpack 'fix-share-path + (lambda _ + (substitute* "source/duke3d/src/common.cpp" + (("/usr/local/share/games") (string-append #$output "/share"))))) + (delete 'configure) + (replace 'install + (lambda _ + (let ((bin (string-append #$output "/bin"))) + (install-file "eduke32" bin) + (install-file "mapster32" bin) + (install-file "package/sdk/m32help.hlp" + (string-append #$output "/share/eduke32")))))))) + (inputs (list alsa-lib + flac + glu + gtk+-2 + libvorbis + libvpx + libxmp + sdl2 + sdl2-mixer)) + (native-inputs + (list gdk-pixbuf pkg-config)) + (synopsis "Engine of the classic PC first person shooter Duke Nukem 3D") + (description "EDuke32 is a free homebrew game engine and source port of +the classic PC first person shooter Duke Nukem 3D—Duke3D for short. A +thousands of features and upgrades were added for regular players and +additional editing capabilities and scripting extensions for homebrew +developers and mod creators. EDuke32 is open source but non-free software. This package does not contain any game file. You can either install packages with game files or or put @file{.grp} game files manually in @file{~/.config/eduke32/}.") - (home-page "https://eduke32.com/") - (license (license:nonfree - "https://eduke32.com/buildlic.txt"))))) + (home-page "https://eduke32.com") + (license + (list license:gpl2 + (license:nonfree "file://package/common/buildlic.txt"))))) (define-public fury - (package - (inherit eduke32) + (package/inherit eduke32 (name "fury") (arguments (substitute-keyword-arguments (package-arguments eduke32) - ((#:make-flags flags ''()) `(cons* "FURY=1" ,flags)) - ((#:phases phases '%standard-phases) - `(modify-phases ,phases - (replace 'install - (lambda _ - (let* ((out (assoc-ref %outputs "out"))) - (install-file "fury" (string-append out "/bin")) - (install-file "mapster32" (string-append out "/bin")) - (install-file "package/common/buildlic.txt" - (string-append out "/share/licenses"))) - #t)))))) + ((#:make-flags flags #~'()) + #~(cons* "FURY=1" #$flags)) + ((#:phases phases #~%standard-phases) + #~(modify-phases #$phases + (add-after 'unpack 'disable-sdl-static + (lambda _ + (substitute* "GNUmakefile" + (("SDL_STATIC := 1") "")))) + (replace 'install + (lambda _ + (install-file "fury" (string-append #$output "/bin")))))))) + (inputs + (alist-delete "libvpx" (package-inputs eduke32))) (synopsis "Game engine for the first-person shooter Ion Fury") (description - (string-append - "This is the @code{eduke32} engine built with support for the Ion Fury + "This is the @code{eduke32} engine built with support for the Ion Fury game. Game data is not provided. Run @command{fury} with the option -@option{-j} to specify the directory containing @file{fury.grp}.")))) +@option{-j} to specify the directory containing @file{fury.grp}."))) diff --git a/nongnu/packages/linux.scm b/nongnu/packages/linux.scm index 61e7f0a..a18ed7e 100644 --- a/nongnu/packages/linux.scm +++ b/nongnu/packages/linux.scm @@ -29,6 +29,7 @@ (define-module (nongnu packages linux) #:use-module (gnu packages) + #:use-module (gnu packages admin) #:use-module (gnu packages base) #:use-module (gnu packages compression) #:use-module (gnu packages cpio) @@ -132,8 +133,8 @@ some freedo package or an output of package-version procedure." "The unmodified Linux kernel, including nonfree blobs, for running Guix System on hardware which requires nonfree software to function.")))) -(define-public linux-6.7 - (corrupt-linux linux-libre-6.7)) +(define-public linux-6.8 + (corrupt-linux linux-libre-6.8)) (define-public linux-6.6 (corrupt-linux linux-libre-6.6)) @@ -153,9 +154,9 @@ on hardware which requires nonfree software to function.")))) (define-public linux-4.19 (corrupt-linux linux-libre-4.19)) -(define-public linux linux-6.7) +(define-public linux linux-6.8) ;; linux-lts points to the *newest* released long-term support version. -(define-public linux-lts linux-6.1) +(define-public linux-lts linux-6.6) (define-public linux-arm64-generic-5.10 (corrupt-linux linux-libre-arm64-generic-5.10 #:name "linux-arm64-generic")) @@ -254,9 +255,7 @@ on hardware which requires nonfree software to function.")))) (append %default-extra-linux-options ;; NOTE: These are configs expected by Guix ;; but missing from XanMod defconfig. - '(("CONFIG_BLK_DEV_NVME" . #t) - ("CONFIG_CRYPTO_XTS" . m) - ("CONFIG_VIRTIO_CONSOLE" . m)))))) + '(("CONFIG_BLK_DEV_NVME" . #t)))))) (display extra-configuration port) (close-port port)) (invoke "make" "oldconfig") @@ -277,17 +276,17 @@ distribution with custom settings and new features. It's built to provide a stable, responsive and smooth desktop experience."))) ;; Linux-XanMod sources -(define-public linux-xanmod-version "6.7.6") +(define-public linux-xanmod-version "6.8.6") (define-public linux-xanmod-revision "xanmod1") (define-public linux-xanmod-source (make-linux-xanmod-source linux-xanmod-version linux-xanmod-revision #:xanmod-branch "main" - #:kernel-hash (base32 "0s8hbcsg7fdvspqam8kzcxygjsznr4zfi60nqgc81l3n4m518cgg") - #:xanmod-hash (base32 "0hv76dj9z17w6zcy25v1ndlmdw593wlbmnw5x903vidb3c6a1dfi"))) + #:kernel-hash (base32 "1wv5x7qhcd05m8m0myyqm2il6mha1sx11h7ppf8yjsxvx2jdwsf9") + #:xanmod-hash (base32 "1ry4qmsis7s2bb6hpkvq30ffgvhzj1w33js67ybnvagzda5vbmci"))) -(define-public linux-xanmod-lts-version "6.6.18") +(define-public linux-xanmod-lts-version "6.6.27") (define-public linux-xanmod-lts-revision "xanmod1") (define-public linux-xanmod-lts-source (make-linux-xanmod-source @@ -295,7 +294,7 @@ stable, responsive and smooth desktop experience."))) linux-xanmod-lts-revision #:xanmod-branch "lts" #:kernel-hash (base32 "1l2nisx9lf2vdgkq910n5ldbi8z25ky1zvl67zgwg2nxcdna09nr") - #:xanmod-hash (base32 "1q33bd4a65l46333l2m7vjn46b0xhdbz508bq7q0bphbmy0bf35m"))) + #:xanmod-hash (base32 "0inlpdscdpqahwlsf8kc2zjp2p83yr2cfqyaxld6m4bjkbg23lvz"))) ;; Linux-XanMod packages (define-public linux-xanmod @@ -316,24 +315,22 @@ stable, responsive and smooth desktop experience."))) (define-public linux-firmware (package (name "linux-firmware") - (version "20240115") + (version "20240312") (source (origin (method url-fetch) (uri (string-append "mirror://kernel.org/linux/kernel/firmware/" "linux-firmware-" version ".tar.xz")) (sha256 (base32 - "13b75kd075famc58pvx4r9268pxn69nyihx7p3i6i7mvkgqayz5b")))) + "152bpl3lzd7jb2z1cl1sfax6jm71bspn7bwc00lci5qqmma7lcmj")))) (build-system gnu-build-system) (arguments - `(#:tests? #f - #:make-flags (list (string-append "DESTDIR=" (assoc-ref %outputs "out"))) - #:phases - (modify-phases %standard-phases - (replace 'install - (lambda* (#:key (make-flags '()) #:allow-other-keys) - (apply invoke "make" "install-nodedup" make-flags))) - (delete 'validate-runpath)))) + (list #:tests? #f + #:strip-binaries? #f + #:validate-runpath? #f + #:make-flags #~(list (string-append "DESTDIR=" #$output)))) + (native-inputs + (list rdfind)) (home-page "https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git") (synopsis "Nonfree firmware blobs for Linux") @@ -347,23 +344,23 @@ if your hardware is supported by one of the smaller firmware packages.") (define (select-firmware keep) "Modify linux-firmware copy list to retain only files matching KEEP regex." - `(lambda _ - (use-modules (ice-9 regex)) - (substitute* "WHENCE" - (("^(File|Link): *([^ ]*)(.*)" _ type file rest) - (string-append (if (string-match ,keep file) type "Skip") ": " file rest))))) + #~(lambda _ + (use-modules (ice-9 regex)) + (substitute* "WHENCE" + (("^(File|RawFile|Link): *([^ ]*)(.*)" _ type file rest) + (string-append (if (string-match #$keep file) type "Skip") ": " file rest))))) (define-public amdgpu-firmware (package (inherit linux-firmware) (name "amdgpu-firmware") (arguments - `(#:license-file-regexp "LICENSE.amdgpu" - ,@(substitute-keyword-arguments (package-arguments linux-firmware) - ((#:phases phases) - `(modify-phases ,phases - (add-after 'unpack 'select-firmware - ,(select-firmware "^amdgpu/"))))))) + (cons* #:license-file-regexp "LICENSE.amdgpu" + (substitute-keyword-arguments (package-arguments linux-firmware) + ((#:phases phases #~%standard-phases) + #~(modify-phases #$phases + (add-after 'unpack 'select-firmware + #$(select-firmware "^amdgpu/"))))))) (home-page "http://support.amd.com/en-us/download/linux") (synopsis "Nonfree firmware for AMD graphics chips") (description "Nonfree firmware for AMD graphics chips. While most AMD @@ -381,12 +378,12 @@ advanced 3D.") (inherit amdgpu-firmware) (name "radeon-firmware") (arguments - `(#:license-file-regexp "LICENSE.radeon" - ,@(substitute-keyword-arguments (package-arguments linux-firmware) - ((#:phases phases) - `(modify-phases ,phases - (add-after 'unpack 'select-firmware - ,(select-firmware "^radeon/"))))))) + (cons* #:license-file-regexp "LICENSE.radeon" + (substitute-keyword-arguments (package-arguments linux-firmware) + ((#:phases phases #~%standard-phases) + #~(modify-phases #$phases + (add-after 'unpack 'select-firmware + #$(select-firmware "^radeon/"))))))) (synopsis "Nonfree firmware for older AMD graphics chips") (description "Nonfree firmware for AMD graphics chips. While most AMD graphics cards can be run with the free Mesa, some cards require a nonfree @@ -438,12 +435,12 @@ and modules, userspace libraries, and bootloader/GPU firmware.") (inherit linux-firmware) (name "atheros-firmware") (arguments - `(#:license-file-regexp "LICEN[CS]E.*[Aa]th" - ,@(substitute-keyword-arguments (package-arguments linux-firmware) - ((#:phases phases) - `(modify-phases ,phases - (add-after 'unpack 'select-firmware - ,(select-firmware "^(ar[3579]|ath[1369]|htc_[79]|qca/|wil6)"))))))) + (cons* #:license-file-regexp "LICEN[CS]E.*[Aa]th" + (substitute-keyword-arguments (package-arguments linux-firmware) + ((#:phases phases #~%standard-phases) + #~(modify-phases #$phases + (add-after 'unpack 'select-firmware + #$(select-firmware "^(ar[3579]|ath[1369]|htc_[79]|qca/|wil6)"))))))) (synopsis "Nonfree firmware blobs for Atheros wireless cards") (description "Nonfree firmware blobs for Atheros wireless cards. This package contains nonfree firmware for the following chips: @@ -614,12 +611,12 @@ WLAN.TF.2.1-00021-QCARMSWP-1 (ath10k/QCA9377/hw1.0/firmware-6.bin) (inherit linux-firmware) (name "ibt-hw-firmware") (arguments - `(#:license-file-regexp "LICENCE.ibt_firmware" - ,@(substitute-keyword-arguments (package-arguments linux-firmware) - ((#:phases phases) - `(modify-phases ,phases - (add-after 'unpack 'select-firmware - ,(select-firmware "^intel/ibt-"))))))) + (cons* #:license-file-regexp "LICENCE.ibt_firmware" + (substitute-keyword-arguments (package-arguments linux-firmware) + ((#:phases phases #~%standard-phases) + #~(modify-phases #$phases + (add-after 'unpack 'select-firmware + #$(select-firmware "^intel/ibt-"))))))) (home-page "http://www.intel.com/support/wireless/wlan/sb/CS-016675.htm") (synopsis "Non-free firmware for Intel bluetooth chips") (description "This firmware is required by the btintel kernel module to @@ -635,12 +632,12 @@ laptops).") (inherit linux-firmware) (name "iwlwifi-firmware") (arguments - `(#:license-file-regexp "LICENCE.iwlwifi_firmware" - ,@(substitute-keyword-arguments (package-arguments linux-firmware) - ((#:phases phases) - `(modify-phases ,phases - (add-after 'unpack 'select-firmware - ,(select-firmware "^iwlwifi-"))))))) + (cons* #:license-file-regexp "LICENCE.iwlwifi_firmware" + (substitute-keyword-arguments (package-arguments linux-firmware) + ((#:phases phases #~%standard-phases) + #~(modify-phases #$phases + (add-after 'unpack 'select-firmware + #$(select-firmware "^iwlwifi-"))))))) (home-page "https://wireless.wiki.kernel.org/en/users/drivers/iwlwifi") (synopsis "Nonfree firmware for Intel wifi chips") (description "The proprietary iwlwifi kernel module is required by many @@ -656,12 +653,12 @@ support for 5GHz and 802.11ac, among others.") (inherit linux-firmware) (name "i915-firmware") (arguments - `(#:license-file-regexp "LICENCE.i915" - ,@(substitute-keyword-arguments (package-arguments linux-firmware) - ((#:phases phases) - `(modify-phases ,phases - (add-after 'unpack 'select-firmware - ,(select-firmware "^i915/"))))))) + (cons* #:license-file-regexp "LICENCE.i915" + (substitute-keyword-arguments (package-arguments linux-firmware) + ((#:phases phases #~%standard-phases) + #~(modify-phases #$phases + (add-after 'unpack 'select-firmware + #$(select-firmware "^i915/"))))))) (home-page "https://01.org/linuxgraphics/gfx-docs/drm/gpu/i915.html") (synopsis "Nonfree firmware for Intel integrated graphics") (description "This package contains the various firmware for Intel @@ -676,13 +673,12 @@ integrated graphics chipsets, including GuC, HuC and DMC.") (inherit linux-firmware) (name "realtek-firmware") (arguments - `(#:license-file-regexp "LICENCE.rtlwifi_firmware.txt" - ,@(substitute-keyword-arguments (package-arguments linux-firmware) - ((#:phases phases) - `(modify-phases ,phases - (add-after 'unpack 'select-firmware - ,(select-firmware - "^(rtlwifi|rtl_nic|rtl_bt|rtw88|rtw89)/"))))))) + (cons* #:license-file-regexp "LICENCE.rtlwifi_firmware.txt" + (substitute-keyword-arguments (package-arguments linux-firmware) + ((#:phases phases #~%standard-phases) + #~(modify-phases #$phases + (add-after 'unpack 'select-firmware + #$(select-firmware "^(rtlwifi|rtl_nic|rtl_bt|rtw88|rtw89)/"))))))) (home-page "https://wireless.wiki.kernel.org/en/users/drivers/rtl819x") (synopsis "Nonfree firmware for Realtek ethernet, wifi, and bluetooth chips") (description @@ -772,8 +768,8 @@ package contains nonfree firmware for the following chips: (deprecated-package "rtl-bt-firmware" realtek-firmware)) (define-public rtl8192eu-linux-module - (let ((commit "a928f08c1dd4f9a1e84d85811a543e974551bc4f") - (revision "6")) + (let ((commit "3af9a868a0ca622d830966ac83aea2bf17cd0d65") + (revision "7")) (package (name "rtl8192eu-linux-module") (version (git-version "0.0.0" revision commit)) @@ -786,7 +782,7 @@ package contains nonfree firmware for the following chips: (file-name (git-file-name name version)) (sha256 (base32 - "1q26kyic4glmgy0hbaq46r067m6cqf7d41chgivyxn8y32rf1fgc")))) + "0d2qzf7xbipjdp1zm2ffqhnda8wasqriqnv6dkl0mhqn2f8za3i8")))) (build-system linux-module-build-system) (arguments `(#:make-flags @@ -852,8 +848,8 @@ network adapters.") (license gpl2)))) (define-public rtl8821cu-linux-module - (let ((commit "a41ef7cabd1aa36fa2b4eb63a71cf719bff11b72") - (revision "1")) + (let ((commit "4f6004af4c4171882f37e2e5d8fb3609fe260617") + (revision "2")) (package (name "rtl8821cu-linux-module") (version (git-version "0.0.0" revision commit)) @@ -865,7 +861,7 @@ network adapters.") (commit commit))) (file-name (git-file-name name version)) (sha256 - (base32 "0fnv4gm4adnf8gbjzc2lljh2a3i111159qira3w0qm1zhyqadaq0")))) + (base32 "09ig0rrkkn00i3d1n6p62n1610kcjgb2h9kbcqdsrmpnlnw5kfl2")))) (build-system linux-module-build-system) (arguments (list @@ -906,8 +902,8 @@ to disable the conflicting rtw88 driver: "https://github.com/morrownr/8821cu-20210916/blob/main/LICENSE"))))) (define-public rtl8812au-aircrack-ng-linux-module - (let ((commit "a3e0c0b6d54546418f046db0dbf1d20e454c9ec2") - (revision "12")) + (let ((commit "63cf0b4584aa8878b0fe8ab38017f31c319bde3d") + (revision "13")) (package (inherit rtl8821ce-linux-module) (name "rtl8812au-aircrack-ng-linux-module") @@ -920,7 +916,7 @@ to disable the conflicting rtw88 driver: (commit commit))) (file-name (git-file-name name version)) (sha256 - (base32 "1hwzsy62h7ik5s54paikcj5ips7mrnfacprciiq412mz5ag28cdn")) + (base32 "103pn6qlj116dm244ygf1wic9dq2qn80lafiyxynyhpckkyhhfxl")) (modules '((guix build utils))) (snippet #~(begin @@ -1154,7 +1150,7 @@ chipsets from Broadcom: (define-public facetimehd (package (name "facetimehd") - (version "0.6.8") + (version "0.6.8.1") (source (origin (method git-fetch) @@ -1164,7 +1160,7 @@ chipsets from Broadcom: (file-name (git-file-name "facetimehd" version)) (sha256 (base32 - "1g0ky9w5klkjndf30mjymq78r6yls9gri9x702nn8qkmgkjbqdsg")))) + "18x12g55bw99ap9cw54v50s5m39dli4nx41jfhb35551mn0jp4c7")))) (build-system linux-module-build-system) (arguments '(#:tests? #f)) @@ -1223,12 +1219,12 @@ your CPU.") (inherit linux-firmware) (name "amd-microcode") (arguments - `(#:license-file-regexp "LICENSE.amd-ucode" - ,@(substitute-keyword-arguments (package-arguments linux-firmware) - ((#:phases phases) - `(modify-phases ,phases - (add-after 'unpack 'select-firmware - ,(select-firmware "^amd-ucode/"))))))) + (cons* #:license-file-regexp "LICENSE.amd-ucode" + (substitute-keyword-arguments (package-arguments linux-firmware) + ((#:phases phases #~%standard-phases) + #~(modify-phases #$phases + (add-after 'unpack 'select-firmware + #$(select-firmware "^amd-ucode/"))))))) (synopsis "Processor microcode firmware for AMD CPUs") (description "Updated system processor microcode for AMD x86-64 processors. AMD releases microcode updates to correct processor behavior as diff --git a/nongnu/packages/messaging.scm b/nongnu/packages/messaging.scm index a28985d..e300915 100644 --- a/nongnu/packages/messaging.scm +++ b/nongnu/packages/messaging.scm @@ -36,7 +36,7 @@ (define-public element-desktop (package (name "element-desktop") - (version "1.11.57") + (version "1.11.64") (source (origin (method url-fetch) @@ -45,7 +45,7 @@ "https://packages.riot.im/debian/pool/main/e/" name "/" name "_" version "_amd64.deb")) (sha256 - (base32 "05318i6z5kkzi01ygr77g5ij0hs4xmy0j23hznkqc4zia02q1vgx")))) + (base32 "043017i51kdpb6aqz7542dyrdw8d6jhqd9zw6v1c63phh1633y56")))) (supported-systems '("x86_64-linux")) (build-system chromium-binary-build-system) (arguments @@ -90,7 +90,7 @@ its core.") (define-public signal-desktop (package (name "signal-desktop") - (version "7.3.0") + (version "7.4.0") (source (origin (method url-fetch) @@ -99,7 +99,7 @@ its core.") "https://updates.signal.org/desktop/apt/pool/s/" name "/" name "_" version "_amd64.deb")) (sha256 - (base32 "1gkcfh94l5nj8p3jk7g80jqq11fb8igi4wm84g67a9qi8n56wcrc")))) + (base32 "069k7kcg8h16q0mm1bqdf7x66qji653apgwhnb52kdqsfzr1ibzm")))) (supported-systems '("x86_64-linux")) (build-system chromium-binary-build-system) (arguments diff --git a/nongnu/packages/mozilla.scm b/nongnu/packages/mozilla.scm index 8a8ce01..0588ad6 100644 --- a/nongnu/packages/mozilla.scm +++ b/nongnu/packages/mozilla.scm @@ -97,19 +97,19 @@ ;; Update this id with every firefox update to its release date. ;; It's used for cache validation and therefore can lead to strange bugs. -(define %firefox-esr-build-id "20240322120907") +(define %firefox-esr-build-id "20240415130026") (define-public firefox-esr (package (name "firefox-esr") - (version "115.9.1esr") + (version "115.10.0esr") (source (origin (method url-fetch) (uri (string-append "https://archive.mozilla.org/pub/firefox/releases/" version "/source/firefox-" version ".source.tar.xz")) (sha256 - (base32 "0agr8s42lpbq5gixsgj5kpcvimbnyx6msr4il4rvmf7gpw47hr93")))) + (base32 "1wpf4vcrvnvhnfzqavbkzqbn51bds1l9f6ld4mzh9xwm7mrkrz8a")))) (build-system gnu-build-system) (arguments (list @@ -532,20 +532,20 @@ MOZ_ENABLE_WAYLAND=1 exec ~a $@\n" ;; Update this id with every firefox update to its release date. ;; It's used for cache validation and therefore can lead to strange bugs. -(define %firefox-build-id "20240322073900") +(define %firefox-build-id "20240429124342") (define-public firefox (package (inherit firefox-esr) (name "firefox") - (version "124.0.1") + (version "125.0.3") (source (origin (method url-fetch) (uri (string-append "https://archive.mozilla.org/pub/firefox/releases/" version "/source/firefox-" version ".source.tar.xz")) (sha256 - (base32 "0hxqd8sfj9zzi1ifni8z5r2hzhjw2pvl7hg3dgzmgq2mm2p1db6x")))) + (base32 "05jnpnc0qym08f7rlapjm36g729445k3nba2rvf4a0sabsw6c726")))) (arguments (substitute-keyword-arguments (package-arguments firefox-esr) ((#:phases phases) diff --git a/nongnu/packages/nvidia.scm b/nongnu/packages/nvidia.scm index f75d0d4..2c6495e 100644 --- a/nongnu/packages/nvidia.scm +++ b/nongnu/packages/nvidia.scm @@ -6,7 +6,7 @@ ;;; Copyright © 2021 Pierre Langlois <pierre.langlois@gmx.com> ;;; Copyright © 2022, 2023 Petr Hodina <phodina@protonmail.com> ;;; Copyright © 2022 Alexey Abramov <levenson@mmer.org> -;;; Copyright © 2022 Hilton Chain <hako@ultrarare.space> +;;; Copyright © 2022, 2023, 2024 Hilton Chain <hako@ultrarare.space> (define-module (nongnu packages nvidia) #:use-module (guix packages) @@ -38,25 +38,17 @@ #:use-module (gnu packages linux) #:use-module (gnu packages m4) #:use-module (gnu packages lsof) - #:use-module (gnu packages perl) #:use-module (gnu packages pkg-config) - #:use-module (gnu packages python) #:use-module (gnu packages python-xyz) - #:use-module (gnu packages python-web) #:use-module (gnu packages qt) - #:use-module (gnu packages terminals) + #:use-module (gnu packages tls) #:use-module (gnu packages video) #:use-module (gnu packages web) #:use-module (gnu packages xdisorg) #:use-module (gnu packages xml) #:use-module (gnu packages xorg) #:use-module (nongnu packages linux) - #:use-module (ice-9 match) - #:use-module (ice-9 regex) - #:use-module (ice-9 format) - #:use-module (ice-9 textual-ports) - #:use-module (ice-9 match) - #:use-module (srfi srfi-1)) + #:use-module (ice-9 match)) (define-public %nvidia-environment-variable-regexps '("^__GL_" ; NVIDIA OpenGL settings. @@ -73,17 +65,65 @@ ;; GSYNC control for Vulkan direct-to-display applications. "^VKDirectGSYNC(Compatible)?Allowed$")) -(define nvidia-version "515.76") +(define-public nvidia-version "550.67") -(define computed-origin-method - (@@ (guix packages) computed-origin-method)) + +;;; +;;; NVIDIA driver checkouts +;;; -;; Extract the driver installer and make it a new origin instance for reusing. -(define (make-nvidia-source version installer) + +(define* (nvidia-source-hash version #:optional (package "nvidia-driver")) + (define %nvidia-source-hashes + '(("550.67" . + (("nvidia-driver" . + "1qnsyzplkxfcc2sj6fcw3ylfp0njvb5z1c0y4v80zzqwqw4il84r") + ("nvidia-settings" . + "18sij736liyhqysvsnqwb6r58pf0zbggxyvyc11psc4ljxg30h8m"))))) + (let ((hashes (assoc-ref %nvidia-source-hashes version))) + (assoc-ref hashes package))) + +(define (nvidia-source-unbundle-libraries version) + #~(begin + (use-modules (guix build utils)) + (for-each delete-file + (find-files "." (string-join + '(;; egl-gbm + "libnvidia-egl-gbm\\.so\\." + ;; egl-wayland + "libnvidia-egl-wayland\\.so\\." + ;; libglvnd + "libEGL\\.so\\." + "libGL\\.so\\." + "libGLESv1_CM\\.so\\." + "libGLESv2\\.so\\." + "libGLX\\.so\\." + "libGLdispatch\\.so\\." + "libOpenGL\\.so\\." + ;; nvidia-settings + "libnvidia-gtk[23]\\.so\\." + ;; opencl-icd-loader + "libOpenCL\\.so\\.") + "|"))))) + +(define* (make-nvidia-source + version hash + #:optional (get-cleanup-snippet nvidia-source-unbundle-libraries)) + "Given VERSION and HASH of an NVIDIA driver installer, return an <origin> for +its unpacked checkout. GET-CLEANUP-SNIPPET is a procedure that accepts the +VERSION as argument and returns a G-expression." + (define installer + (origin + (method url-fetch) + (uri (string-append + "https://us.download.nvidia.com/XFree86/Linux-x86_64/" + version "/NVIDIA-Linux-x86_64-" version ".run")) + (sha256 hash))) (origin - (method computed-origin-method) + (method (@@ (guix packages) computed-origin-method)) (file-name (string-append "nvidia-driver-" version "-checkout")) (sha256 #f) + (snippet (get-cleanup-snippet version)) (uri (delay (with-imported-modules '((guix build utils)) @@ -92,13 +132,14 @@ (ice-9 ftw)) (set-path-environment-variable "PATH" '("bin") - (list (canonicalize-path #+bash-minimal) - (canonicalize-path #+coreutils) - (canonicalize-path #+gawk) - (canonicalize-path #+grep) - (canonicalize-path #+tar) - (canonicalize-path #+which) - (canonicalize-path #+xz))) + '#+(list bash-minimal + coreutils + gawk + grep + tar + which + xz + zstd)) (setenv "XZ_OPT" (string-join (%xz-parallel-args))) (invoke "sh" #$installer "-x") (copy-recursively @@ -107,122 +148,105 @@ (not (member file '("." "..")))))) #$output))))))) -(define nvidia-source - (let ((version nvidia-version)) - (make-nvidia-source - version - (origin - (method url-fetch) - (uri (string-append - "https://us.download.nvidia.com/XFree86/Linux-x86_64/" - version "/NVIDIA-Linux-x86_64-" version ".run")) - (sha256 - (base32 "0i5zyvlsjnfkpfqhw6pklp0ws8nndyiwxrg4pj04jpwnxf6a38n6")))))) +(define-public nvidia-source + (make-nvidia-source + nvidia-version + (base32 (nvidia-source-hash nvidia-version)))) -(define-public gpustat - (package - (name "gpustat") - (version "1.0.0") - (source (origin - (method url-fetch) - (uri (pypi-uri "gpustat" version)) - (sha256 - (base32 - "1wg3yikkqdrcxp5xscyb9rxifgfwv7qh73xv4airab63b3w8y7jq")))) - (build-system python-build-system) - (arguments - '(#:tests? #f)) - (propagated-inputs (list python-blessed python-nvidia-ml-py python-psutil - python-six)) - (native-inputs (list python-mock python-pytest python-pytest-runner)) - (home-page "https://github.com/wookayin/gpustat") - (synopsis "Utility to monitor NVIDIA GPU status and usage") - (description - "This package provides an utility to monitor NVIDIA GPU status -and usage.") - (license license-gnu:expat))) + +;;; +;;; NVIDIA drivers +;;; -(define-public python-nvidia-ml-py - (package - (name "python-nvidia-ml-py") - (version "11.495.46") - (source (origin - (method url-fetch) - (uri (pypi-uri "nvidia-ml-py" version)) - (sha256 - (base32 - "09cnb7xasd7brby52j70y7fqsfm9n6gvgqf769v0cmj74ypy2s4g")))) - (build-system python-build-system) - (arguments - (list #:phases #~(modify-phases %standard-phases - (add-after 'unpack 'fix-libnvidia - (lambda _ - (substitute* "pynvml.py" - (("libnvidia-ml.so.1") - (string-append #$(this-package-input - "nvidia-driver") - "/lib/libnvidia-ml.so.1")))))))) - (inputs (list nvidia-driver)) - (home-page "https://forums.developer.nvidia.com") - (synopsis "Python Bindings for the NVIDIA Management Library") - (description "This package provides official Python Bindings for the NVIDIA -Management Library") - (license license-gnu:bsd-3))) -(define-public nvidia-htop - (package - (name "nvidia-htop") - (version "1.0.5") - (source (origin - (method url-fetch) - (uri (pypi-uri "nvidia-htop" version)) - (sha256 - (base32 - "0lv9cpccpkbg0d577irm1lp9rx6pacyk2pk9v41k9s9hyl4b7hvx")))) - (build-system python-build-system) - (arguments - (list #:phases #~(modify-phases %standard-phases - (add-after 'unpack 'fix-libnvidia - (lambda _ - (substitute* "nvidia-htop.py" - (("nvidia-smi") - (string-append #$(this-package-input - "nvidia-driver") - "/bin/nvidia-smi")))))))) - (inputs (list nvidia-driver)) - (propagated-inputs (list python-termcolor)) - (home-page "https://github.com/peci1/nvidia-htop") - (synopsis "Tool to enrich the output of nvidia-smi") - (description "This package provides tool for enriching the output of -nvidia-smi.") - (license license-gnu:bsd-3))) +(define %nvidia-script-create-device-nodes + (program-file + "create-device-nodes.scm" + (with-imported-modules '((guix build utils)) + #~(begin + (use-modules (ice-9 regex) + (rnrs io ports) + (srfi srfi-1) + (guix build utils)) -(define-public python-py3nvml - (package - (name "python-py3nvml") - (version "0.2.7") - (source (origin - (method url-fetch) - (uri (pypi-uri "py3nvml" version)) - (sha256 - (base32 - "0wxxky9amy38q7qjsdmmznk1kqdzwd680ps64i76cvlab421vvh9")))) - (build-system python-build-system) - (arguments - (list #:phases #~(modify-phases %standard-phases - (add-after 'unpack 'fix-libnvidia - (lambda _ - (substitute* "py3nvml/py3nvml.py" - (("libnvidia-ml.so.1") - (string-append #$(this-package-input - "nvidia-driver") - "/lib/libnvidia-ml.so.1")))))))) - (propagated-inputs (list nvidia-driver python-xmltodict)) - (home-page "https://github.com/fbcotter/py3nvml") - (synopsis "Unoffcial Python 3 Bindings for the NVIDIA Management Library") - (description "This package provides unofficial Python 3 Bindings for the -NVIDIA Management Library") - (license license-gnu:bsd-3))) + (define %nvidia-character-devices + (call-with-input-file "/proc/devices" + (lambda (port) + (filter-map + (lambda (line) + (if (string-contains line "nvidia") + (apply cons (reverse (string-tokenize line))) + #f)) + (string-split (get-string-all port) #\newline))))) + + (define %nvidia-driver-device-minors + (let ((device-minor-regexp (make-regexp "^Device Minor: \t (.*)"))) + (append-map + (lambda (file) + (call-with-input-file file + (lambda (port) + (filter-map + (lambda (line) + (let ((matched (regexp-exec device-minor-regexp line))) + (if matched + (match:substring matched 1) + #f))) + (string-split (get-string-all port) #\newline))))) + (find-files "/proc/driver/nvidia/gpus/" "information$")))) + + (define (create-device-node path name minor) + (let ((major + (or (assoc-ref %nvidia-character-devices name) + (assoc-ref %nvidia-character-devices "nvidia-frontend"))) + (mknod #$(file-append coreutils "/bin/mknod"))) + (system* mknod "-Zm0666" path "c" major minor))) + + (define (main args) + (case (string->symbol (first args)) + ((nvidia_modeset) + (create-device-node "/dev/nvidia-modeset" "nvidia-modeset" "254")) + ((nvidia_uvm) + (begin + (create-device-node "/dev/nvidia-uvm" "nvidia-uvm" "0") + (create-device-node "/dev/nvidia-uvm-tools" "nvidia-uvm" "1"))) + ((nvidia) + (begin + (create-device-node "/dev/nvidiactl" "nvidiactl" "255") + (for-each + (lambda (minor) + (create-device-node + (string-append "/dev/nvidia" minor) "nvidia" minor)) + %nvidia-driver-device-minors))))) + + (main (cdr (command-line))))))) + +;; Adapted from <https://github.com/Frogging-Family/nvidia-all/blob/master/60-nvidia.rules> +(define %nvidia-udev-rules + (mixed-text-file + "90-nvidia.rules" "\ +# Make sure device nodes are present even when the DDX is not started for the Wayland/EGLStream case +KERNEL==\"nvidia\", RUN+=\"" %nvidia-script-create-device-nodes " nvidia\" +KERNEL==\"nvidia_modeset\", RUN+=\"" %nvidia-script-create-device-nodes " nvidia_modeset\" +KERNEL==\"nvidia_uvm\", RUN+=\"" %nvidia-script-create-device-nodes " nvidia_uvm\" + +# Enable runtime PM for NVIDIA VGA/3D controller devices +ACTION==\"bind\", SUBSYSTEM==\"pci\", ATTR{vendor}==\"0x10de\", ATTR{class}==\"0x03[0-9]*\", TEST==\"power/control\", ATTR{power/control}=\"auto\" +# Enable runtime PM for NVIDIA Audio devices +ACTION==\"bind\", SUBSYSTEM==\"pci\", ATTR{vendor}==\"0x10de\", ATTR{class}==\"0x040300\", TEST==\"power/control\", ATTR{power/control}=\"auto\" +# Enable runtime PM for NVIDIA USB xHCI Host Controller devices +ACTION==\"bind\", SUBSYSTEM==\"pci\", ATTR{vendor}==\"0x10de\", ATTR{class}==\"0x0c0330\", TEST==\"power/control\", ATTR{power/control}=\"auto\" +# Enable runtime PM for NVIDIA USB Type-C UCSI devices +ACTION==\"bind\", SUBSYSTEM==\"pci\", ATTR{vendor}==\"0x10de\", ATTR{class}==\"0x0c8000\", TEST==\"power/control\", ATTR{power/control}=\"auto\" + +# Disable runtime PM for NVIDIA VGA/3D controller devices +ACTION==\"unbind\", SUBSYSTEM==\"pci\", ATTR{vendor}==\"0x10de\", ATTR{class}==\"0x03[0-9]*\", TEST==\"power/control\", ATTR{power/control}=\"on\" +# Disable runtime PM for NVIDIA Audio devices +ACTION==\"unbind\", SUBSYSTEM==\"pci\", ATTR{vendor}==\"0x10de\", ATTR{class}==\"0x040300\", TEST==\"power/control\", ATTR{power/control}=\"on\" +# Disable runtime PM for NVIDIA USB xHCI Host Controller devices +ACTION==\"unbind\", SUBSYSTEM==\"pci\", ATTR{vendor}==\"0x10de\", ATTR{class}==\"0x0c0330\", TEST==\"power/control\", ATTR{power/control}=\"on\" +# Disable runtime PM for NVIDIA USB Type-C UCSI devices +ACTION==\"unbind\", SUBSYSTEM==\"pci\", ATTR{vendor}==\"0x10de\", ATTR{class}==\"0x0c8000\", TEST==\"power/control\", ATTR{power/control}=\"on\" +")) (define-public nvidia-driver (package @@ -233,79 +257,93 @@ NVIDIA Management Library") (arguments (list #:modules '((guix build copy-build-system) (guix build utils) - (ice-9 ftw) (ice-9 popen) (ice-9 rdelim) (ice-9 regex) - (ice-9 textual-ports)) + (srfi srfi-26)) #:install-plan - #~`((,#$(match (or (%current-target-system) (%current-system)) - ("i686-linux" "32") - ("x86_64-linux" ".") - (_ ".")) - "lib/" #:include-regexp ("^./[^/]+\\.so") #:exclude-regexp ("nvidia_drv\\.so" "libglxserver_nvidia\\.so\\..*")) - ("." "share/nvidia/" #:include-regexp ("nvidia-application-profiles.*")) - ("." "share/egl/egl_external_platform.d/" #:include-regexp (".*_nvidia_.*\\.json")) + #~`((#$(match (or (%current-target-system) (%current-system)) + ("i686-linux" "32") + ("x86_64-linux" ".") + (_ ".")) + "lib/" #:include-regexp ("^./[^/]+\\.so")) + ("." "share/nvidia/" #:include-regexp ("nvidia-application-profiles")) + ("." "share/egl/egl_external_platform.d/" #:include-regexp ("(gbm|wayland)\\.json")) + ("10_nvidia.json" "share/glvnd/egl_vendor.d/") ("90-nvidia.rules" "lib/udev/rules.d/") - ("nvidia-drm-outputclass.conf" "share/x11/xorg.conf.d/") + ("nvidia-drm-outputclass.conf" "share/X11/xorg.conf.d/") ("nvidia-dbus.conf" "share/dbus-1/system.d/") - ("nvidia-smi.1.gz" "share/man/man1/") ("nvidia.icd" "etc/OpenCL/vendors/") - ("nvidia_drv.so" "lib/xorg/modules/drivers/") ("nvidia_icd.json" "share/vulkan/icd.d/") - ("nvidia_layers.json" "share/vulkan/implicit_layer.d/") - (,(string-append "libglxserver_nvidia.so." #$version) "lib/xorg/modules/extensions/")) + ("nvidia_layers.json" "share/vulkan/implicit_layer.d/")) #:phases #~(modify-phases %standard-phases (delete 'strip) (add-after 'unpack 'create-misc-files (lambda* (#:key inputs #:allow-other-keys) - ;; Vulkan layer configuration - (for-each (lambda (file) - (substitute* file - (("lib(GLX|nvidia).*\\.so\\..*" all) - (string-append #$output "/lib/" all)))) - (scandir "." (lambda (name) - (string-contains name ".json")))) + ;; EGL external platform configuraiton + (substitute* '("10_nvidia_wayland.json" + "15_nvidia_gbm.json") + (("libnvidia-egl-(wayland|gbm)\\.so\\.." all) + (search-input-file inputs (string-append "lib/" all)))) + + ;; EGL vendor ICD configuration + (substitute* "10_nvidia.json" + (("libEGL_nvidia\\.so\\.." all) + (string-append #$output "/lib/" all))) ;; OpenCL vendor ICD configuration (substitute* "nvidia.icd" - ((".*" all) (string-append #$output "/lib/" all))) - - ;; Add udev rules for nvidia - (let ((rules "90-nvidia.rules")) - (call-with-output-file rules - (lambda (port) - (put-string port (format #f "~ -KERNEL==\"nvidia\", RUN+=\"@sh@ -c '@mknod@ -m 666 /dev/nvidiactl c $$(@grep@ nvidia-frontend /proc/devices | @cut@ -d \\ -f 1) 255'\" -KERNEL==\"nvidia_modeset\", RUN+=\"@sh@ -c '@mknod@ -m 666 /dev/nvidia-modeset c $$(@grep@ nvidia-frontend /proc/devices | @cut@ -d \\ -f 1) 254'\" -KERNEL==\"card*\", SUBSYSTEM==\"drm\", DRIVERS==\"nvidia\", RUN+=\"@sh@ -c '@mknod@ -m 666 /dev/nvidia0 c $$(@grep@ nvidia-frontend /proc/devices | @cut@ -d \\ -f 1) 0'\" -KERNEL==\"nvidia_uvm\", RUN+=\"@sh@ -c '@mknod@ -m 666 /dev/nvidia-uvm c $$(@grep@ nvidia-uvm /proc/devices | @cut@ -d \\ -f 1) 0'\" -KERNEL==\"nvidia_uvm\", RUN+=\"@sh@ -c '@mknod@ -m 666 /dev/nvidia-uvm-tools c $$(@grep@ nvidia-uvm /proc/devices | @cut@ -d \\ -f 1) 0'\" -")))) - (substitute* rules - (("@\\<(sh|grep|mknod|cut)\\>@" all cmd) - (search-input-file inputs (string-append "/bin/" cmd))))))) + (("libnvidia-opencl\\.so\\.." all) + (string-append #$output "/lib/" all))) + + ;; Vulkan ICD & layer configuraiton + (substitute* '("nvidia_icd.json" + "nvidia_layers.json") + (("libGLX_nvidia\\.so\\.." all) + (string-append #$output "/lib/" all))) + + ;; Add udev rules + (symlink #$%nvidia-udev-rules "90-nvidia.rules"))) + (add-after 'install 'add-architecture-to-filename + (lambda _ + (for-each + (lambda (path) + (let* ((out #$output) + (system #$(or (%current-target-system) + (%current-system))) + (dash (string-index system #\-)) + (arch (string-take system dash)) + + (dot (string-index-right path #\.)) + (base (string-take path dot)) + (ext (string-drop path (+ 1 dot)))) + ;; <...>/nvidia.icd -> <...>/nvidia.x86_64.icd + ;; <...>/nvidia_icd.json -> <...>/nvidia_icd.x86_64.json + (rename-file + (string-append out path) + (string-append out base "." arch "." ext)))) + '("/etc/OpenCL/vendors/nvidia.icd" + "/share/egl/egl_external_platform.d/10_nvidia_wayland.json" + "/share/egl/egl_external_platform.d/15_nvidia_gbm.json" + "/share/glvnd/egl_vendor.d/10_nvidia.json" + "/share/vulkan/icd.d/nvidia_icd.json" + "/share/vulkan/implicit_layer.d/nvidia_layers.json")))) (add-after 'install 'patch-elf (lambda _ (let* ((ld.so (string-append #$(this-package-input "glibc") #$(glibc-dynamic-linker))) (rpath (string-join - (list "$ORIGIN" - (string-append #$output "/lib") - (string-append #$gcc:lib "/lib") - (string-append #$gtk+-2 "/lib") - (string-append #$(this-package-input "atk") "/lib") - (string-append #$(this-package-input "cairo") "/lib") - (string-append #$(this-package-input "gdk-pixbuf") "/lib") - (string-append #$(this-package-input "glib") "/lib") + (list (string-append #$output "/lib") + (string-append #$openssl-1.1 "/lib") + (string-append #$(this-package-input "egl-wayland") "/lib") + (string-append (ungexp (this-package-input "gcc") "lib") "/lib") (string-append #$(this-package-input "glibc") "/lib") - (string-append #$(this-package-input "gtk+") "/lib") (string-append #$(this-package-input "libdrm") "/lib") + (string-append #$(this-package-input "libglvnd") "/lib") (string-append #$(this-package-input "libx11") "/lib") (string-append #$(this-package-input "libxext") "/lib") - (string-append #$(this-package-input "mesa") "/lib") - (string-append #$(this-package-input "pango") "/lib") + (string-append #$(this-package-input "openssl") "/lib") (string-append #$(this-package-input "wayland") "/lib")) ":"))) (define (patch-elf file) @@ -314,26 +352,70 @@ KERNEL==\"nvidia_uvm\", RUN+=\"@sh@ -c '@mknod@ -m 666 /dev/nvidia-uvm-tools c $ (invoke "patchelf" "--set-interpreter" ld.so file)) (invoke "patchelf" "--set-rpath" rpath file) (display " done\n")) + (for-each (lambda (file) (when (elf-file? file) (patch-elf file))) - (append (find-files #$output ".*\\.so") - (find-files (string-append #$output "/bin"))))))) - (add-before 'patch-elf 'install-nvidia-smi + (find-files #$output))))) + (add-before 'patch-elf 'install-commands + (lambda _ + (when (string-match + "x86_64-linux" + (or #$(%current-target-system) #$(%current-system))) + (for-each + (lambda (binary) + (let ((bindir (string-append #$output "/bin")) + (manual (string-append binary ".1.gz")) + (mandir (string-append #$output "/share/man/man1"))) + (install-file binary bindir) + (when (file-exists? manual) + (install-file manual mandir)))) + '("nvidia-cuda-mps-control" + "nvidia-cuda-mps-server" + "nvidia-smi"))))) + (add-before 'patch-elf 'relocate-libraries (lambda _ - (if (string-match "x86_64-linux" - (or #$(%current-target-system) #$(%current-system))) - (install-file "nvidia-smi" (string-append #$output "/bin"))))) + (let* ((version #$(package-version this-package)) + (libdir (string-append #$output "/lib")) + (gbmdir (string-append libdir "/gbm")) + (vdpaudir (string-append libdir "/vdpau")) + (xorgmoddir (string-append libdir "/xorg/modules")) + (xorgdrvdir (string-append xorgmoddir "/drivers")) + (xorgextdir (string-append xorgmoddir "/extensions")) + (move-to-dir (lambda (file dir) + (install-file file dir) + (delete-file file)))) + (for-each + (lambda (file) + (mkdir-p gbmdir) + (with-directory-excursion gbmdir + (symlink file "nvidia-drm_gbm.so"))) + (find-files libdir "libnvidia-allocator\\.so\\.")) + + (for-each + (cut move-to-dir <> vdpaudir) + (find-files libdir "libvdpau_nvidia\\.so\\.")) + + (for-each + (cut move-to-dir <> xorgdrvdir) + (find-files libdir "nvidia_drv\\.so$")) + + (for-each + (lambda (file) + (move-to-dir file xorgextdir) + (with-directory-excursion xorgextdir + (symlink (basename file) + "libglxserver_nvidia.so"))) + (find-files libdir "libglxserver_nvidia\\.so\\."))))) (add-after 'patch-elf 'create-short-name-symlinks (lambda _ (define (get-soname file) - (when elf-file? file - (let* ((cmd (string-append "patchelf --print-soname " file)) - (port (open-input-pipe cmd)) - (soname (read-line port))) - (close-pipe port) - soname))) - + (when (elf-file? file) + (let* ((cmd (string-append "patchelf --print-soname " file)) + (port (open-input-pipe cmd)) + (soname (read-line port))) + (close-pipe port) + soname))) (for-each (lambda (lib) (let ((lib-soname (get-soname lib))) @@ -353,45 +435,40 @@ KERNEL==\"nvidia_uvm\", RUN+=\"@sh@ -c '@mknod@ -m 666 /dev/nvidia-uvm-tools c $ (symlink source target) (display " done\n"))) (list soname base)))))) - (find-files #$output "\\.so")) - (symlink (string-append "libglxserver_nvidia.so." #$version) - (string-append #$output "/lib/xorg/modules/extensions/" "libglxserver_nvidia.so")) - (symlink (string-append "libnvidia-allocator.so." #$version) - (string-append #$output "/lib/nvidia-drm_gbm.so" ))))))) + (find-files #$output "\\.so\\."))))))) (supported-systems '("i686-linux" "x86_64-linux")) (native-inputs (list patchelf)) (inputs - (list `(,gcc "lib") - atk - bash-minimal - cairo - coreutils - gdk-pixbuf - glib + (list egl-gbm + egl-wayland + `(,gcc "lib") glibc - grep - gtk+ - gtk+-2 - kmod libdrm + libglvnd-for-nvda libx11 libxext - linux-lts - mesa - pango + openssl + openssl-1.1 wayland)) (home-page "https://www.nvidia.com") - (synopsis "Proprietary NVIDIA driver") + (synopsis "Proprietary NVIDIA driver (libraries)") (description - "This is the evil NVIDIA driver. Don't forget to add @code{service -nvidia-service-type} to your @file{config.scm}. Further xorg should be -configured by adding: @code{(modules (cons* nvidia-driver -%default-xorg-modules)) (drivers '(\"nvidia\"))} to @code{xorg-configuration}. -") + "This package provides libraries of the proprietary NVIDIA driver. It's +mainly used as a dependency of other packages. For user-facing purpose, use +@code{nvda} instead.") (license (license:nonfree (format #f "file:///share/doc/nvidia-driver-~a/LICENSE" version))))) +(define-public nvidia-libs + (deprecated-package "nvidia-libs" nvidia-driver)) + + +;;; +;;; NVIDIA frimwares +;;; + + (define-public nvidia-firmware (let ((base nvidia-driver)) (package @@ -399,98 +476,29 @@ configured by adding: @code{(modules (cons* nvidia-driver (name "nvidia-firmware") (arguments (list #:install-plan - #~'(("firmware" #$(string-append - "lib/firmware/nvidia/" (package-version base)))) + #~'(("firmware" #$(string-append "lib/firmware/nvidia/" + (package-version this-package)))) #:phases #~(modify-phases %standard-phases (delete 'strip)))) + (propagated-inputs '()) (inputs '()) (native-inputs '()) - (properties `((hidden? . #t)))))) + (synopsis "Proprietary NVIDIA driver (GSP firmwares)") + (description + "This package provides firmwares for NVIDIA's GPU System Processor. +Firmware installation can be done with @code{nvidia-service-type}, however +whether GSP mode is enabled by default or not depends on the specific GPU +product. -(define-public nvidia-exec - (package - (name "nvidia-exec") - (version "0.1.0") - (source (origin - (method git-fetch) - (uri (git-reference - (url "https://github.com/pedro00dk/nvidia-exec") - (commit (string-append "v" version)))) - (file-name (git-file-name name version)) - (sha256 - (base32 - "079alqgz3drv5mvx059fzhj3f20rnljl7r4yihfd5qq7djgmvv0v")))) - (build-system copy-build-system) - (arguments - (list #:install-plan #~`(("nvx" "bin/")) - #:modules #~((guix build copy-build-system) - (guix build utils) - (srfi srfi-1)) - #:phases #~(modify-phases %standard-phases - (add-after 'install 'wrap-nvx - (lambda* (#:key inputs outputs #:allow-other-keys) - (wrap-program (string-append #$output "/bin/nvx") - `("PATH" ":" prefix - ,(fold (lambda (input paths) - (let* ((in (assoc-ref - inputs input)) - (bin (string-append - in "/bin"))) - (append (filter - file-exists? - (list bin)) - paths))) - '() - '("jq" "lshw" "lsof"))))))))) - (inputs (list bash-minimal jq lshw lsof)) - (home-page "https://github.com/pedro00dk/nvidia-exec") - (synopsis "GPU switching without login out for Nvidia Optimus laptops") - (description - "This package provides GPU switching without login out for Nvidia Optimus -laptops.") - (license license-gnu:gpl3+))) +To enable GSP mode manually, add @code{\"NVreg_EnableGpuFirmware=1\"} to +@code{kernel-arguments} field of the @code{operating-system} configuration.")))) -(define-public nvidia-nvml - (package - (name "nvidia-nvml") - (version "352.79") - (source - (origin - (method url-fetch) - (uri (string-append "https://developer.download.nvidia.com/compute/cuda/7.5/Prod/gdk/" - (format #f "gdk_linux_amd64_~a_release.run" - (string-replace-substring version "." "_")))) - (sha256 - (base32 - "1r2cwm0j9svaasky3qw46cpg2q6rrazwzrc880nxh6bismyd3a9z")) - (file-name (string-append "nvidia-nvml-" version "-checkout")))) - (build-system copy-build-system) - (arguments - (list #:phases - #~(modify-phases %standard-phases - (replace 'unpack - (lambda _ - (invoke "sh" #$source "--tar" "xvf")))) - #:install-plan - ''(("payload/nvml/lib" "lib") - ("payload/nvml/include" "include/nvidia/gdk") - ("payload/nvml/example" "src/gdk/nvml/examples") - ("payload/nvml/doc/man" "share/man") - ("payload/nvml/README.txt" "README.txt") - ("payload/nvml/COPYRIGHT.txt" "COPYRIGHT.txt")))) - (home-page "https://www.nvidia.com") - (synopsis "The NVIDIA Management Library (NVML)") - (description "C-based programmatic interface for monitoring and managing various -states within NVIDIA Tesla GPUs. It is intended to be a platform for -building 3rd party applications, and is also the underlying library for the -NVIDIA-supported nvidia-smi tool. NVML is thread-safe so it is safe to make -simultaneous NVML calls from multiple threads.") - ;; Doesn't have any specific LICENSE file, but see COPYRIGHT.txt for details. - (license (license:nonfree "file://COPYRIGHT.txt")))) + +;;; +;;; NVIDIA kernel modules +;;; -(define-public nvidia-libs - (deprecated-package "nvidia-libs" nvidia-driver)) (define-public nvidia-module (package @@ -525,16 +533,23 @@ simultaneous NVML calls from multiple threads.") '()) ,@make-flags))))))) (home-page "https://www.nvidia.com") - (synopsis "Proprietary NVIDIA kernel modules") + (synopsis "Proprietary NVIDIA driver (kernel modules)") (description - "This package provides the evil NVIDIA proprietary kernel modules.") + "This package provides kernel modules of the proprietary NVIDIA driver. +Module setup can be done with @code{nvidia-service-type}, to actually use these +modules, also add @code{modprobe.blacklist=nouveau} to @code{kernel-arguments} +field of the @code{operating-system} configuration. + +If the NVIDIA card is not used for displaying, or on a Wayland environment, +add @code{nvidia_drm.modeset=1} to @code{kernel-arguments} as well.") (license (license:nonfree (format #f "file:///share/doc/nvidia-driver-~a/LICENSE" version))))) (define-public nvidia-module-open (let ((base nvidia-module)) - (package/inherit base + (package + (inherit base) (name "nvidia-module-open") (arguments (substitute-keyword-arguments (package-arguments base) @@ -544,14 +559,28 @@ simultaneous NVML calls from multiple threads.") ;; <https://github.com/llvm/llvm-project/issues/55820> ((#:source-directory _) "kernel-open"))) (home-page "https://github.com/NVIDIA/open-gpu-kernel-modules") - (synopsis "NVIDIA kernel module") + (synopsis "Open source NVIDIA kernel modules") (description - "This package provides NVIDIA open-gpu-kernel-modules. However, they -are only for the latest GPU architectures Turing and Ampere. Also they still -require firmware file @code{gsp.bin} to be loaded as well as closed source -userspace tools from the corresponding driver release.") + "This package provides open source NVIDIA kernel modules, however +proprietary firmware and libraries are still necessary, and these modules +require GPU System Processor to be present (Turing or later architectures) and +enabled (see also the description of @code{nvidia-firmware} package). + +Module setup can be done with @code{nvidia-service-type} (with @code{module} +field of @code{nvidia-configuration} set to @code{nvidia-module-open}), to +actually use these modules, also add @code{modprobe.blacklist=nouveau} to +@code{kernel-arguments} field of the @code{operating-system} configuration. + +If the NVIDIA card is not used for displaying, or on a Wayland environment, +add @code{nvidia_drm.modeset=1} to @code{kernel-arguments} as well.") (license license-gnu:gpl2)))) + +;;; +;;; ‘nvidia-settings’ packages +;;; + + (define-public nvidia-settings (package (name "nvidia-settings") @@ -562,24 +591,40 @@ userspace tools from the corresponding driver release.") (url "https://github.com/NVIDIA/nvidia-settings") (commit version))) (file-name (git-file-name name version)) - (sha256 - (base32 - "1hplc42115c06cc555cjmw3c9371qn7ibwjpqjybcf6ixfd6lryq")))) + (modules '((guix build utils))) + (snippet '(delete-file-recursively "src/jansson")) + (sha256 (base32 (nvidia-source-hash version name))))) (build-system gnu-build-system) (arguments (list #:tests? #f ;no test suite #:make-flags - #~(list (string-append "PREFIX=" #$output) + #~(list "NV_USE_BUNDLED_LIBJANSSON=0" + (string-append "PREFIX=" #$output) (string-append "CC=" #$(cc-for-target))) #:phases #~(modify-phases %standard-phases (delete 'configure) + (add-after 'unpack 'fix-application-profile-path + (lambda* (#:key inputs #:allow-other-keys) + (substitute* "src/gtk+-2.x/ctkappprofile.c" + (("/usr") "/run/booted-system/profile")))) + (add-after 'install 'install-desktop-file + (lambda _ + (substitute* "doc/nvidia-settings.desktop" + (("^Exec=.*") "Exec=nvidia-settings\n") + (("__NVIDIA_SETTINGS_DESKTOP_CATEGORIES__") "Settings")) + (install-file "doc/nvidia-settings.desktop" + (string-append + #$output "/share/applications")) + (install-file "doc/nvidia-settings.png" + (string-append + #$output "/share/icons/hicolor/128x128/apps")))) (add-after 'install 'wrap-program (lambda* (#:key outputs #:allow-other-keys) (let ((out (assoc-ref outputs "out"))) (wrap-program (string-append out "/bin/nvidia-settings") - `("LD_LIBRARY_PATH" ":" prefix - (,(string-append out "/lib/")))))))))) + `("LD_LIBRARY_PATH" ":" prefix + (,(string-append out "/lib/")))))))))) (native-inputs (list m4 pkg-config)) (inputs (list bash-minimal @@ -587,6 +632,7 @@ userspace tools from the corresponding driver release.") glu gtk+ gtk+-2 + jansson libvdpau libx11 libxext @@ -600,6 +646,275 @@ configuration, creating application profiles, gpu monitoring and more.") (home-page "https://github.com/NVIDIA/nvidia-settings") (license license-gnu:gpl2))) + +;;; +;;; ‘nvda’ packages +;;; + + +(define-public libglvnd-for-nvda + (hidden-package + (package + (inherit libglvnd) + (arguments + (substitute-keyword-arguments (package-arguments libglvnd) + ((#:configure-flags flags #~'()) + #~(cons* "-Dc_link_args=-Wl,-rpath=$ORIGIN" #$flags)) + ((#:phases phases #~%standard-phases) + #~(modify-phases #$phases + (delete 'shrink-runpath)))))))) + +(define-public mesa-for-nvda + (hidden-package + (package + (inherit mesa) + (propagated-inputs + (modify-inputs (package-propagated-inputs mesa) + (prepend libglvnd-for-nvda))) + (arguments + (substitute-keyword-arguments (package-arguments mesa) + ((#:configure-flags flags #~'()) + #~(cons* "-Dglvnd=true" #$flags)) + ((#:phases phases #~%standard-phases) + #~(modify-phases #$phases + (add-after 'install 'fix-egl-vendor-icd + (lambda _ + (substitute* (string-append + #$output "/share/glvnd/egl_vendor.d/50_mesa.json") + (("libEGL_mesa\\.so\\.." all) + (string-append #$output "/lib/" all))))) + (add-after 'set-layer-path-in-manifests 'add-architecture-to-filename + (lambda _ + (for-each + (lambda (path) + (let* ((out #$output) + (system #$(or (%current-target-system) + (%current-system))) + (dash (string-index system #\-)) + (arch (string-take system dash)) + + (dot (string-index-right path #\.)) + (base (string-take path dot)) + (ext (string-drop path (+ 1 dot)))) + ;; <...>/50_mesa.json -> <...>/50_mesa.x86_64.json + (rename-file + (string-append out path) + (string-append out base "." arch "." ext)))) + '("/share/glvnd/egl_vendor.d/50_mesa.json" + "/share/vulkan/explicit_layer.d/VkLayer_MESA_overlay.json" + "/share/vulkan/implicit_layer.d/VkLayer_MESA_device_select.json"))))))))))) + +;; nvda is used as a name because it has the same length as mesa which is +;; required for grafting +(define-public nvda + (package + (inherit nvidia-driver) + (name "nvda") + (version (string-pad-right + (package-version nvidia-driver) + (string-length (package-version mesa-for-nvda)) + #\0)) + (source #f) + (build-system trivial-build-system) + (arguments + (list #:modules '((guix build union)) + #:builder + #~(begin + (use-modules (guix build union)) + (union-build + #$output + '#$(list (this-package-input "libglvnd") + (this-package-input "mesa") + (this-package-input "nvidia-driver")))))) + (native-search-paths + (list + ;; https://github.com/NVIDIA/egl-wayland/issues/39 + (search-path-specification + (variable "__EGL_EXTERNAL_PLATFORM_CONFIG_DIRS") + (files '("share/egl/egl_external_platform.d"))) + ;; https://gitlab.freedesktop.org/glvnd/libglvnd/-/blob/master/src/EGL/icd_enumeration.md + (search-path-specification + (variable "__EGL_VENDOR_LIBRARY_DIRS") + (files '("share/glvnd/egl_vendor.d"))) + ;; See also: ‘src/gbm/main/backend.c’ in mesa source. + (search-path-specification + (variable "GBM_BACKENDS_PATH") + (files '("lib/gbm"))) + (search-path-specification + (variable "VDPAU_DRIVER_PATH") + (files '("lib/vdpau")) + (separator #f)) + ;; https://github.com/KhronosGroup/Vulkan-Loader/blob/main/docs/LoaderLayerInterface.md + (search-path-specification + (variable "XDG_DATA_DIRS") + (files '("share"))))) + (synopsis "Nonguix's user-facing NVIDIA driver package") + (description + "This package provides a drop-in replacement for @code{mesa} and is +intended to be installed by @code{nvidia-service-type}. + +To actually use the NVIDIA card, replacement must be applied for individual +packages, this can be done either by rewriting inputs with +@code{--with-input=mesa=nvda} or grafting with @code{--with-graft=mesa=nvda}. +For a programmatical way, the procedure @code{replace-mesa} can be used. + +Additionally, if the NVIDIA card is not used for displaying, environment +variables @code{__GLX_VENDOR_LIBRARY_NAME=nvidia} and +@code{__NV_PRIME_RENDER_OFFLOAD=1} may be set.") + (native-inputs '()) + (propagated-inputs + (append + (package-propagated-inputs mesa-for-nvda) + (package-propagated-inputs nvidia-driver))) + (inputs (list mesa-for-nvda nvidia-driver)) + (outputs '("out")))) + +(define mesa/fake + (package + (inherit mesa) + (replacement nvda))) + +(define-public replace-mesa + (package-input-rewriting `((,mesa . ,mesa/fake)))) + + +;;; +;;; Other packages +;;; + + +(define-public gpustat + (package + (name "gpustat") + (version "1.0.0") + (source (origin + (method url-fetch) + (uri (pypi-uri "gpustat" version)) + (sha256 + (base32 + "1wg3yikkqdrcxp5xscyb9rxifgfwv7qh73xv4airab63b3w8y7jq")))) + (build-system python-build-system) + (arguments + '(#:tests? #f)) + (propagated-inputs (list python-blessed python-nvidia-ml-py python-psutil + python-six)) + (native-inputs (list python-mock python-pytest python-pytest-runner)) + (home-page "https://github.com/wookayin/gpustat") + (synopsis "Utility to monitor NVIDIA GPU status and usage") + (description + "This package provides an utility to monitor NVIDIA GPU status +and usage.") + (license license-gnu:expat))) + +(define-public nvidia-exec + (package + (name "nvidia-exec") + (version "0.1.0") + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/pedro00dk/nvidia-exec") + (commit (string-append "v" version)))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "079alqgz3drv5mvx059fzhj3f20rnljl7r4yihfd5qq7djgmvv0v")))) + (build-system copy-build-system) + (arguments + (list #:install-plan #~`(("nvx" "bin/")) + #:modules #~((guix build copy-build-system) + (guix build utils) + (srfi srfi-1)) + #:phases #~(modify-phases %standard-phases + (add-after 'install 'wrap-nvx + (lambda* (#:key inputs outputs #:allow-other-keys) + (wrap-program (string-append #$output "/bin/nvx") + `("PATH" ":" prefix + ,(fold (lambda (input paths) + (let* ((in (assoc-ref + inputs input)) + (bin (string-append + in "/bin"))) + (append (filter + file-exists? + (list bin)) + paths))) + '() + '("jq" "lshw" "lsof"))))))))) + (inputs (list bash-minimal jq lshw lsof)) + (home-page "https://github.com/pedro00dk/nvidia-exec") + (synopsis "GPU switching without login out for Nvidia Optimus laptops") + (description + "This package provides GPU switching without login out for Nvidia Optimus +laptops.") + (license license-gnu:gpl3+))) + +(define-public nvidia-htop + (package + (name "nvidia-htop") + (version "1.0.5") + (source (origin + (method url-fetch) + (uri (pypi-uri "nvidia-htop" version)) + (sha256 + (base32 + "0lv9cpccpkbg0d577irm1lp9rx6pacyk2pk9v41k9s9hyl4b7hvx")))) + (build-system python-build-system) + (arguments + (list #:phases #~(modify-phases %standard-phases + (add-after 'unpack 'fix-libnvidia + (lambda _ + (substitute* "nvidia-htop.py" + (("nvidia-smi") + (string-append #$(this-package-input + "nvidia-driver") + "/bin/nvidia-smi")))))))) + (inputs (list nvidia-driver)) + (propagated-inputs (list python-termcolor)) + (home-page "https://github.com/peci1/nvidia-htop") + (synopsis "Tool to enrich the output of nvidia-smi") + (description "This package provides tool for enriching the output of +nvidia-smi.") + (license license-gnu:bsd-3))) + +(define-public nvidia-nvml + (package + (name "nvidia-nvml") + (version "352.79") + (source + (origin + (method url-fetch) + (uri (string-append "https://developer.download.nvidia.com/compute/cuda/7.5/Prod/gdk/" + (format #f "gdk_linux_amd64_~a_release.run" + (string-replace-substring version "." "_")))) + (sha256 + (base32 + "1r2cwm0j9svaasky3qw46cpg2q6rrazwzrc880nxh6bismyd3a9z")) + (file-name (string-append "nvidia-nvml-" version "-checkout")))) + (build-system copy-build-system) + (arguments + (list #:phases + #~(modify-phases %standard-phases + (replace 'unpack + (lambda _ + (invoke "sh" #$source "--tar" "xvf")))) + #:install-plan + ''(("payload/nvml/lib" "lib") + ("payload/nvml/include" "include/nvidia/gdk") + ("payload/nvml/example" "src/gdk/nvml/examples") + ("payload/nvml/doc/man" "share/man") + ("payload/nvml/README.txt" "README.txt") + ("payload/nvml/COPYRIGHT.txt" "COPYRIGHT.txt")))) + (home-page "https://www.nvidia.com") + (synopsis "The NVIDIA Management Library (NVML)") + (description "C-based programmatic interface for monitoring and managing various +states within NVIDIA Tesla GPUs. It is intended to be a platform for +building 3rd party applications, and is also the underlying library for the +NVIDIA-supported nvidia-smi tool. NVML is thread-safe so it is safe to make +simultaneous NVML calls from multiple threads.") + ;; Doesn't have any specific LICENSE file, but see COPYRIGHT.txt for details. + (license (license:nonfree "file://COPYRIGHT.txt")))) + (define-public nvidia-system-monitor (package (name "nvidia-system-monitor") @@ -621,7 +936,7 @@ configuration, creating application profiles, gpu monitoring and more.") (lambda _ (let ((nvidia-smi (string-append #$(this-package-input "nvidia-driver") - "/bin/nvidia-smi"))) + "/bin/nvidia-smi"))) (substitute* "src/core/InfoProvider.cpp" (("nvidia-smi") nvidia-smi)) @@ -642,43 +957,56 @@ configuration, creating application profiles, gpu monitoring and more.") "This package provides a task manager for Nvidia graphics cards.") (license license-gnu:expat))) -;; nvda is used as a name because it has the same length as mesa which is -;; required for grafting -(define-public nvda +(define-public python-nvidia-ml-py (package - (inherit nvidia-driver) - (name "nvda") - (source #f) - (build-system trivial-build-system) + (name "python-nvidia-ml-py") + (version "11.495.46") + (source (origin + (method url-fetch) + (uri (pypi-uri "nvidia-ml-py" version)) + (sha256 + (base32 + "09cnb7xasd7brby52j70y7fqsfm9n6gvgqf769v0cmj74ypy2s4g")))) + (build-system python-build-system) (arguments - (list #:modules '((guix build union)) - #:builder - #~(begin - (use-modules (guix build union) - (srfi srfi-1) - (ice-9 regex)) - (union-build #$output - (list #$(this-package-input "mesa") - #$(this-package-input "nvidia-driver")) - #:resolve-collision - (lambda (files) - (let ((file (if (string-match "nvidia-driver" - (first files)) - (first files) - (last files)))) - (format #t "chosen ~a ~%" file) - file)))))) - (description - "These are the libraries of the evil NVIDIA driver, packaged in such a -way that you can use the transformation option @code{--with-graft=mesa=nvda} -to use the NVIDIA driver with a package that requires mesa.") - (inputs (list mesa nvidia-driver)) - (outputs '("out")))) + (list #:phases #~(modify-phases %standard-phases + (add-after 'unpack 'fix-libnvidia + (lambda _ + (substitute* "pynvml.py" + (("libnvidia-ml.so.1") + (string-append #$(this-package-input + "nvidia-driver") + "/lib/libnvidia-ml.so.1")))))))) + (inputs (list nvidia-driver)) + (home-page "https://forums.developer.nvidia.com") + (synopsis "Python Bindings for the NVIDIA Management Library") + (description "This package provides official Python Bindings for the NVIDIA +Management Library") + (license license-gnu:bsd-3))) -(define mesa/fake +(define-public python-py3nvml (package - (inherit mesa) - (replacement nvda))) - -(define-public replace-mesa - (package-input-rewriting `((,mesa . ,mesa/fake)))) + (name "python-py3nvml") + (version "0.2.7") + (source (origin + (method url-fetch) + (uri (pypi-uri "py3nvml" version)) + (sha256 + (base32 + "0wxxky9amy38q7qjsdmmznk1kqdzwd680ps64i76cvlab421vvh9")))) + (build-system python-build-system) + (arguments + (list #:phases #~(modify-phases %standard-phases + (add-after 'unpack 'fix-libnvidia + (lambda _ + (substitute* "py3nvml/py3nvml.py" + (("libnvidia-ml.so.1") + (string-append #$(this-package-input + "nvidia-driver") + "/lib/libnvidia-ml.so.1")))))))) + (propagated-inputs (list nvidia-driver python-xmltodict)) + (home-page "https://github.com/fbcotter/py3nvml") + (synopsis "Unoffcial Python 3 Bindings for the NVIDIA Management Library") + (description "This package provides unofficial Python 3 Bindings for the +NVIDIA Management Library") + (license license-gnu:bsd-3))) diff --git a/nongnu/packages/productivity.scm b/nongnu/packages/productivity.scm index 1065399..e6158f9 100644 --- a/nongnu/packages/productivity.scm +++ b/nongnu/packages/productivity.scm @@ -24,7 +24,7 @@ (define-public anytype (package (name "anytype") - (version "0.39.0") + (version "0.40.0") (source (origin (method url-fetch) @@ -34,7 +34,7 @@ (file-name (string-append "anytype-" version ".deb")) (sha256 (base32 - "10y037qwm6k28min2sgpshrlpirc1p0zn3b4syxrrz494x5g2ivi")))) + "01q6dzks8hjb2whdkj7c816fji7rn5dpx00ss7rxgvxb5rdz19gr")))) (build-system chromium-binary-build-system) (arguments (list @@ -52,8 +52,8 @@ "libGLESv2.so" "libvk_swiftshader.so" "libvulkan.so.1" - "resources/app.asar.unpacked/dist/nativeMessagingHost" - "resources/app.asar.unpacked/node_modules/keytar/build/Release/keytar.node")) + "resources/app.asar.unpacked/node_modules/keytar/build/Release/keytar.node" + "resources/app.asar.unpacked/node_modules/keytar/build/Release/obj.target/keytar.node")) #:install-plan #~'(("opt/" "/share") ("usr/share/" "/share")) diff --git a/nongnu/packages/video.scm b/nongnu/packages/video.scm index b2cec1b..e5af3a1 100644 --- a/nongnu/packages/video.scm +++ b/nongnu/packages/video.scm @@ -1,5 +1,6 @@ ;;; SPDX-License-Identifier: GPL-3.0-or-later ;;; Copyright © 2022 Jelle Licht <jlicht@fsfe.org> +;;; Copyright © 2024 Oleg Pykhalov <go.wigust@gmail.com> (define-module (nongnu packages video) #:use-module (gnu packages pkg-config) @@ -10,12 +11,13 @@ #:use-module (guix git-download) #:use-module (guix packages) #:use-module (guix utils) - #:use-module ((guix licenses) #:prefix license:)) + #:use-module ((guix licenses) #:prefix license:) + #:use-module (nongnu packages chromium)) (define-public gmmlib (package (name "gmmlib") - (version "22.3.9") + (version "22.3.19") (source (origin (method git-fetch) (uri (git-reference @@ -24,7 +26,7 @@ (file-name (git-file-name name version)) (sha256 (base32 - "0m88lxlqqs5wdk4icf2ahbigr0q87j1c0damq7q0r55h72pf6zyv")))) + "0p3wp6xcvpb4jzw4fsf6554qy91iblmq9y50ph3iy29m19q6nznb")))) (build-system cmake-build-system) (arguments ;; Tests are run as part of the normal build step @@ -40,7 +42,7 @@ for VAAPI.") (define-public intel-media-driver (package (name "intel-media-driver") - (version "23.3.0") + (version "24.1.5") (source (origin (method git-fetch) (uri (git-reference @@ -49,7 +51,7 @@ for VAAPI.") (file-name (git-file-name name version)) (sha256 (base32 - "1zh6zgfyp14zlnd6jvhqz9q5rlyk7cb3nam791slh0h7r5f0iimm")))) + "1jm4imld48scj0j499wq5zbdjv4gg7hg2sawljqnjvy09dmp09bs")))) (build-system cmake-build-system) (inputs (list libva gmmlib)) (native-inputs (list pkg-config)) @@ -92,3 +94,65 @@ graphics hardware.") (package-description intel-media-driver) " This build of intel-media-driver includes nonfree blobs to fully enable the video decode capabilities of supported Intel GPUs.")))) + +(define-public obs-with-cef + (package + (inherit obs) + (name "obs-with-cef") + (inputs + (append (package-inputs obs) + `(("chromium-embedded-framework" ,chromium-embedded-framework)))) + (arguments + (substitute-keyword-arguments (package-arguments obs) + ((#:configure-flags flags) + #~(append #$flags + '("-DBUILD_BROWSER=ON" + "-DCEF_ROOT_DIR=../source/cef"))) + ((#:phases phases) + #~(modify-phases #$phases + (add-before 'configure 'add-cef + (lambda* (#:key inputs #:allow-other-keys) + (let ((chromium-embedded-framework + #$(this-package-input "chromium-embedded-framework"))) + (mkdir-p "cef/Release") + (mkdir-p "cef/Resources") + (for-each (lambda (file) + (symlink file (string-append "cef/Release/" + (basename file))) + (symlink file (string-append "cef/Resources/" + (basename file)))) + (filter + (lambda (file) + (not (string= (basename (dirname file)) + "locales"))) + (find-files + (string-append chromium-embedded-framework + "/share/cef")))) + (symlink (string-append chromium-embedded-framework + "/lib/libcef.so") + "cef/Release/libcef.so") + (mkdir-p "cef/libcef_dll_wrapper") + (symlink (string-append chromium-embedded-framework + "/lib/libcef_dll_wrapper.a") + "cef/libcef_dll_wrapper/libcef_dll_wrapper.a") + (symlink (string-append chromium-embedded-framework + "/include") + "cef/include")))) + (add-after 'install 'symlink-obs-browser + ;; Required for lib/obs-plugins/obs-browser.so file. + (lambda* (#:key outputs #:allow-other-keys) + (symlink + (string-append #$output + "/lib/libobs-frontend-api.so.0") + (string-append #$output + "/lib/obs-plugins/libobs-frontend-api.so.0")) + (symlink + (string-append #$output + "/lib/libobs.so.0") + (string-append #$output + "/lib/obs-plugins/libobs.so.0")))))))) + (description + (string-append + (package-description obs) + " This build of OBS includes embeded Chromium-based browser to enable +Browser source.")))) diff --git a/nongnu/packages/vpn.scm b/nongnu/packages/vpn.scm index c7be7e4..ad3bb8a 100644 --- a/nongnu/packages/vpn.scm +++ b/nongnu/packages/vpn.scm @@ -12,7 +12,7 @@ (define-public zerotier (package (name "zerotier") - (version "1.8.4") + (version "1.12.2") (source (origin (method git-fetch) (uri (git-reference @@ -21,16 +21,17 @@ (file-name (git-file-name name version)) (sha256 (base32 - "101b1k9f3cpbgj0l87ya1cbqs9dv0qiayjap4m29fxyjra8hbkb8")))) + "0p5rpvh137gf5y9ylip7kxfl4argv34sr4wiiygvfk670rifnk57")))) (build-system gnu-build-system) (arguments - `(#:phases + `(#:make-flags (list "ZT_SSO_SUPPORTED=0") ; We don't need SSO/OIDC + #:phases (modify-phases %standard-phases ;; There is no ./configure (delete 'configure) (replace 'check - (lambda _ - (invoke "make" "selftest") + (lambda* (#:key make-flags #:allow-other-keys) + (apply invoke "make" "selftest" make-flags) (invoke "./zerotier-selftest"))) (replace 'install (lambda* (#:key outputs #:allow-other-keys) diff --git a/nongnu/services/nvidia.scm b/nongnu/services/nvidia.scm index 985e12b..81a5d5f 100644 --- a/nongnu/services/nvidia.scm +++ b/nongnu/services/nvidia.scm @@ -1,15 +1,15 @@ ;;; SPDX-License-Identifier: GPL-3.0-or-later -;;; Copyright © 2022 Hilton Chain <hako@ultrarare.space> +;;; Copyright © 2022, 2024 Hilton Chain <hako@ultrarare.space> (define-module (nongnu services nvidia) + #:use-module (guix gexp) + #:use-module (guix records) #:use-module (gnu packages) #:use-module (gnu packages linux) #:use-module (gnu services) #:use-module (gnu services base) #:use-module (gnu services linux) #:use-module (gnu services shepherd) - #:use-module (guix gexp) - #:use-module (guix records) #:use-module (nongnu packages nvidia) #:export (nvidia-configuration nvidia-configuration? @@ -19,24 +19,32 @@ (define-record-type* <nvidia-configuration> nvidia-configuration make-nvidia-configuration nvidia-configuration? - (nvidia-driver nvidia-configuration-nvidia-driver - (default (list nvidia-driver))) ; list of file-like - (nvidia-firmware nvidia-configuration-nvidia-firmware - (default (list nvidia-firmware))) ; list of file-like - (nvidia-module nvidia-configuration-nvidia-module - (default (list nvidia-module))) ; list of file-like - (modules nvidia-configuration-modules - (default (list "nvidia-uvm")))) ; list of string + (driver nvidia-configuration-driver + (default nvda)) ; file-like + (firmware nvidia-configuration-firmware + (default nvidia-firmware)) ; file-like + (module nvidia-configuration-module + (default nvidia-module))) ; file-like (define (nvidia-shepherd-service config) - (list (shepherd-service - (documentation "Unload nvidia-uvm module on powering off.") - (provision '(nvidia)) - (requirement '(user-processes)) - (start #~(const #t)) - (stop #~(lambda _ - (let ((rmmod #$(file-append kmod "/bin/rmmod"))) - (zero? (system* rmmod "nvidia-uvm")))))))) + (let ((nvidia-driver (nvidia-configuration-driver config)) + (nvidia-smi (file-append nvidia-driver "/bin/nvidia-smi"))) + (list (shepherd-service + (documentation "Prepare system environment for NVIDIA driver.") + (provision '(nvidia)) + (requirement '(udev)) + (one-shot? #t) + (modules '(((guix build utils) #:select (invoke/quiet)) + ((rnrs io ports) #:select (get-line)))) + (start + #~(lambda _ + (when (file-exists? "/proc/driver/nvidia") + (let ((modprobe (call-with-input-file + "/proc/sys/kernel/modprobe" get-line))) + (false-if-exception + (begin + (invoke/quiet modprobe "--" "nvidia_uvm") + (invoke/quiet #$nvidia-smi))))))))))) (define nvidia-service-type (service-type @@ -44,13 +52,13 @@ (extensions (list (service-extension shepherd-root-service-type nvidia-shepherd-service) + (service-extension profile-service-type + (compose list nvidia-configuration-driver)) (service-extension udev-service-type - nvidia-configuration-nvidia-driver) + (compose list nvidia-configuration-driver)) (service-extension firmware-service-type - nvidia-configuration-nvidia-firmware) + (compose list nvidia-configuration-firmware)) (service-extension linux-loadable-module-service-type - nvidia-configuration-nvidia-module) - (service-extension kernel-module-loader-service-type - nvidia-configuration-modules))) + (compose list nvidia-configuration-module)))) (default-value (nvidia-configuration)) - (description "Load NVIDIA modules."))) + (description "Prepare system environment for NVIDIA driver."))) diff --git a/nongnu/system/install.scm b/nongnu/system/install.scm index 100e278..508621e 100644 --- a/nongnu/system/install.scm +++ b/nongnu/system/install.scm @@ -2,20 +2,46 @@ ;;; Copyright © 2019 Alex Griffin <a@ajgrf.com> ;;; Copyright © 2019 Pierre Neidhardt <mail@ambrevar.xyz> ;;; Copyright © 2022 Jonathan Brielmaier <jonathan.brielmaier@web.de> +;;; Copyright © 2024 Hilton Chain <hako@ultrarare.space> ;; Generate a bootable image (e.g. for USB sticks, etc.) with: -;; $ guix system disk-image nongnu/system/install.scm +;; $ guix system image --image-type=iso9660 nongnu/system/install.scm (define-module (nongnu system install) + #:use-module (guix channels) + #:use-module (guix gexp) #:use-module (gnu packages curl) + #:use-module (gnu packages package-management) #:use-module (gnu packages version-control) #:use-module (gnu packages vim) #:use-module (gnu packages zile) + #:use-module (gnu services) + #:use-module (gnu services base) #:use-module (gnu system) #:use-module (gnu system install) #:use-module (nongnu packages linux) #:export (installation-os-nonfree)) +;; https://substitutes.nonguix.org/signing-key.pub +(define %signing-key + (plain-file "nonguix.pub" "\ +(public-key + (ecc + (curve Ed25519) + (q #C1FD53E5D4CE971933EC50C9F307AE2171A2D3B52C804642A7A35F84F3A4EA98#)))")) + +(define %channels + (cons* (channel + (name 'nonguix) + (url "https://gitlab.com/nonguix/nonguix") + ;; Enable signature verification: + (introduction + (make-channel-introduction + "897c1a470da759236cc11798f4e0a5f7d4d59fbc" + (openpgp-fingerprint + "2A39 3FFF 68F4 EF7A 3D29 12AF 6F51 20A0 22FB B2D5")))) + %default-channels)) + (define installation-os-nonfree (operating-system (inherit installation-os) @@ -27,6 +53,19 @@ git neovim zile) - (operating-system-packages installation-os))))) + (operating-system-packages installation-os))) + (services + (modify-services (operating-system-user-services installation-os) + (guix-service-type + config => (guix-configuration + (inherit config) + (guix (guix-for-channels %channels)) + (authorized-keys + (cons* %signing-key + %default-authorized-guix-keys)) + (substitute-urls + `(,@%default-substitute-urls + "https://substitutes.nonguix.org")) + (channels %channels))))))) installation-os-nonfree diff --git a/nonguix/build/chromium-binary-build-system.scm b/nonguix/build/chromium-binary-build-system.scm index 0fed9bf..8429742 100644 --- a/nonguix/build/chromium-binary-build-system.scm +++ b/nonguix/build/chromium-binary-build-system.scm @@ -4,7 +4,6 @@ (define-module (nonguix build chromium-binary-build-system) #:use-module ((guix build gnu-build-system) #:prefix gnu:) #:use-module ((nonguix build binary-build-system) #:prefix binary:) - #:use-module (nonguix build utils) #:use-module (guix build utils) #:use-module (ice-9 ftw) #:use-module (ice-9 match) @@ -24,9 +23,9 @@ (nss (assoc-ref inputs "nss")) (wrap-inputs (map cdr inputs)) (lib-directories - (build-paths-from-inputs '("lib") wrap-inputs)) + (search-path-as-list '("lib") wrap-inputs)) (bin-directories - (build-paths-from-inputs + (search-path-as-list '("bin" "sbin" "libexec") wrap-inputs))) (for-each diff --git a/nonguix/build/utils.scm b/nonguix/build/utils.scm index e7d6966..4de2ac2 100644 --- a/nonguix/build/utils.scm +++ b/nonguix/build/utils.scm @@ -97,23 +97,3 @@ contents: (call-with-output-file result (lambda (port) (for-each (cut dump <> port) files)))) - -(define build-paths-for-input - (lambda (dirs input) - (filter-map - (lambda (sub-directory) - (let ((directory - (string-append - input "/" sub-directory))) - (and - (directory-exists? directory) - directory))) - dirs))) - -(define build-paths-from-inputs - (lambda (dirs inputs) - (reduce append '() - (map - (lambda (input) - (build-paths-for-input dirs input)) - inputs)))) |