Hello, I am trying to install the nvidia drivers on a headless guix server so that I can host a jellyfin container. The machine has an nvidia gpu and no integrated graphics.
For context, the system was building and worked before I tried making the changes to my config to add nvidia drivers. Also, mesa was failing to build after my initial reconfigure so I did a guix pull.
I see this from reconfigure (before and after the pull):
building /gnu/store/2nr23gc8rady4gkxzk690zy6sfcj3v1b-mesa-25.1.3.drv...
\ 'configure' phasebuilder for `/gnu/store/2nr23gc8rady4gkxzk690zy6sfcj3v1b-mesa-25.1.3.drv' failed with exit code 1
build of /gnu/store/2nr23gc8rady4gkxzk690zy6sfcj3v1b-mesa-25.1.3.drv failed
View build log at '/var/log/guix/drvs/2n/r23gc8rady4gkxzk690zy6sfcj3v1b-mesa-25.1.3.drv.gz'.
cannot build derivation `/gnu/store/llsl76kx0chq0pblrm1d0wy2hk65zc2i-nvda-570.18.drv': 1 dependencies couldn't be built
building /gnu/store/cjxp5a8sa71n0py3wncv0z9cmrlfywvj-nvidia-firmware-570.181.drv...
cannot build derivation `/gnu/store/dc41hmrr6gmrpavvj1is5gg4q10y5fyj-profile.drv': 1 dependencies couldn't be built
building /gnu/store/7agqnv9jx7w6ikszxasmrkni2108xkp6-raw-initrd.drv...
cannot build derivation `/gnu/store/75c1145znch41vz1sksknmbdz2hgfrx3-system.drv': 1 dependencies couldn't be built
guix system: error: build of `/gnu/store/75c1145znch41vz1sksknmbdz2hgfrx3-system.drv' failed
I looked at the build log indicated and I see this:
Library m found: YES
Message: libdrm 2.4.121 needed because amdgpu has the highest requirement
Run-time dependency libdrm_intel found: YES 2.4.124
Run-time dependency libdrm_amdgpu found: YES 2.4.124
Run-time dependency libdrm found: YES 2.4.124
Did not find CMake 'cmake'
Found CMake: NO
Run-time dependency libudev found: NO (tried pkgconfig and cmake)
../mesa-25.1.3/meson.build:1767:13: ERROR: Failed running '/gnu/store/kl1j1g1p4mv3xz1x19izpbfjilyfrxc3-llvm-for-mesa-18.1.8/b\
in/llvm-config', binary or interpreter not executable.
Possibly wrong architecture or the executable bit is not set.
I’m not sure why it is trying to build mesa as this is a headless system. I printed out the %base-packages and there were no mesa packages in there.
These are the changes I made to my config.scm to install and use the nvidia drivers:
(use-modules (gnu)
...
+ (nongnu packages nvidia)
+ (nongnu services nvidia)
+ (nongnu packages nvidia)
+ (nongnu services nvidia)
...
)
-(use-service-modules networking ssh containers dbus desktop)
-(use-package-modules screen ssh)
+(use-service-modules linux networking ssh containers dbus desktop)
+(use-package-modules linux screen ssh)
(kernel-arguments (list "console=ttyS0,115200"
"systemd.unified_cgroup_hierarchy=1"
- "cgroup_no_v1=all"))
+ "cgroup_no_v1=all"
+ "modprobe.blacklist=nouveau"
+ "nvidia_drm.modeset=1"))
(packages (cons* screen
emacs-no-x
emacs-magit
...
+ mesa-for-nvda
+ nvda
+ nvidia-driver
%base-packages))
(services (append (list
...
+ (service nvidia-service-type)
...
)
%base-services)))
Entire config.scm
(use-modules (gnu)
(gnu packages emacs)
(gnu packages emacs-xyz)
(gnu packages containers)
(gnu packages certs)
(gnu packages perl)
(gnu packages commencement)
(gnu packages autotools)
(gnu packages cmake)
(gnu packages linux)
(gnu packages python)
(gnu packages rsync)
(gnu packages freedesktop)
(gnu packages version-control)
(gnu packages mtools)
(gnu packages base)
(gnu packages nfs)
(gnu packages gl)
(gnu packages admin)
(gnu services networking)
(gnu services base)
(nongnu packages linux)
(nongnu packages nvidia)
(nongnu services nvidia)
(gnu system)
(gnu system shadow)
(gnu system file-systems)
(gnu system accounts)
(gnu services containers)
(gnu services dbus)
(gnu services desktop)
(guix packages)
(guix utils)
(srfi srfi-1)
)
(use-service-modules linux networking ssh containers dbus desktop)
(use-package-modules linux screen ssh)
(define (get-admin-user user-list)
(find (lambda (x)
(equal? (user-account-comment x) "Administrator"))
user-list))
(define (get-current-admin user-list)
(user-account-name (get-admin-user user-list)))
(define %homelab-user-accounts
(list
(user-account
(name "jesse")
(comment "Administrator")
(group "users")
(supplementary-groups '("wheel"
"audio" "video"
"netdev" "cgroup" )))
))
(define %iptables-rules
;; Made this by doing the suggested iptables cli commands
;; then doing iptables-save > iptables.txt
;; then copying that to here
"# Generated by iptables-save v1.8.11 on Sun Aug 10 23:25:52 2025
*nat
:PREROUTING ACCEPT [2:300]
:INPUT ACCEPT [2:300]
:OUTPUT ACCEPT [0:0]
:POSTROUTING ACCEPT [0:0]
-A PREROUTING -p tcp -m tcp --dport 80 -j REDIRECT --to-ports 8080
-A PREROUTING -p tcp -m tcp --dport 443 -j REDIRECT --to-ports 8443
-A PREROUTING -p tcp -m tcp --dport 222 -j REDIRECT --to-ports 8222
COMMIT
# Completed on Sun Aug 10 23:25:52 2025
# Generated by iptables-save v1.8.11 on Sun Aug 10 23:25:52 2025
*filter
:INPUT ACCEPT [136:33123]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [32:3402]
COMMIT
# Completed on Sun Aug 10 23:25:52 2025
")
(operating-system
(kernel linux)
(firmware (list linux-firmware))
(host-name "homelab")
(timezone "America/Detroit")
(locale "en_US.utf8")
(bootloader (bootloader-configuration
(bootloader grub-efi-bootloader)
(targets '("/boot"))))
(kernel-arguments (list "console=ttyS0,115200"
"systemd.unified_cgroup_hierarchy=1"
"cgroup_no_v1=all"
"modprobe.blacklist=nouveau"
"nvidia_drm.modeset=1"))
(file-systems (cons* (file-system
(device (file-system-label "system-root"))
(mount-point "/")
(type "btrfs"))
(file-system
(device (file-system-label "ESP"))
(mount-point "/boot")
(type "vfat"))
%base-file-systems
))
(users (append
%homelab-user-accounts
%base-user-accounts))
(packages (cons* screen
emacs-no-x
emacs-magit
emacs-multi-vterm
emacs-geiser-guile
emacs-geiser
emacs-vterm
perl
libtool
gcc-toolchain
;; make
cmake
iptables
python
git
rsync
rsync
udisks
lvm2
mtools
podman podman-compose
nfs-utils
smartmontools
lshw
mesa-for-nvda
nvda
nvidia-driver
%base-packages))
(services (append (list
(service openssh-service-type
(openssh-configuration
(openssh openssh-sans-x)
(port-number xxxx)))
(service static-networking-service-type
(list (static-networking
(addresses
(list (network-address
(device "eno1")
(value "xxx.xxx.xxx.xxx/xx"))))
(routes
(list (network-route
(destination "default")
(gateway "xxx.xxx.xxx.xxx"))))
(name-servers '("xxx.xxx.xxx.xxx")))
))
;; Services for proprietary NVIDIA drivers
(service nvidia-service-type)
;; Services for podman ___________________________________________
(service dbus-root-service-type)
(service elogind-service-type)
(service iptables-service-type
(iptables-configuration
(ipv4-rules (plain-file "iptables.rules" %iptables-rules)
)))
(service rootless-podman-service-type)
(simple-service 'homelab-subids
subids-service-type
(subids-extension
(subgids
(list
(subid-range (name (get-current-admin
%homelab-user-accounts)))))
(subuids
(list
(subid-range (name (get-current-admin
%homelab-user-accounts))
(start 100700))))))
)
%base-services)))
channels.scm
(list (channel
(name 'guix)
(url "https://git.savannah.gnu.org/git/guix.git")
(branch "master")
(introduction
(make-channel-introduction
"9edb3f66fd807b096b48283debdcddccfea34bad"
(openpgp-fingerprint
"BBB0 2DDF 2CEA F6A8 0D1D E643 A2A0 6DF2 A33A 54FA"))))
(channel
(name 'nonguix)
(url "https://gitlab.com/nonguix/nonguix")
(branch "master")
(introduction
(make-channel-introduction
"897c1a470da759236cc11798f4e0a5f7d4d59fbc"
(openpgp-fingerprint
"2A39 3FFF 68F4 EF7A 3D29 12AF 6F51 20A0 22FB B2D5")))))