[TRACKING] GNU Guix System on the Framework

Thank you for the detailed response. I did take a look at what System Crafters had posted and it seems fairly well documented. If only we didn’t have the disconnect issues with the 1TB expansion card, I could have done it ASAP, I need to figure storage issues now before I try a bare metal dual boot with Slackware now.

I’m partial to KDE, Gnome somehow doesn’t suit my palette.

1 Like

In case you didn’t know, Guix does not have KDE in their repositories. There are a few smaller supported packages but the full Plasma desktop has not been ported - there’s some effort but inconclusive as of yet. I believe Gnome, Sway, and Emacs X WM (EXWM) are the most popular ones (EXWM especially since its main configuration language is also Scheme, and ties together well with Emacs and Guix).


I gave in yesterday after I posted and decided to try Guix again. I’m using Guix for the main system and any CLI applications, and Nix for user/GUI applications. I need to figure out how to use Home Services and get all that configuration abstracted - but so far based on the system configuration there’s only one thing you need to run post-install.

Here’s my config:

;; Indicate which modules to import to access the variables
;; used in this configuration.
;; /etc/config.scm # system.scm
(use-modules
 (gnu)
 ;; nonguix linux kernel - includes firmware
 (nongnu packages linux)
 (nongnu packages firmware)
 (nongnu system linux-initrd))
(use-service-modules 
 authentication
 cups
 desktop
 docker
 networking
 nix
 security-token
 ssh
 syncthing
 virtualization
 xorg)
(use-package-modules
 admin
 certs
 compression
 curl
 emacs
 emacs-xyz
 file
 fonts
 gnome
 gnupg
 package-management
 password-utils
 security-token
 version-control
 virtualization
 vim)

(operating-system
 (kernel linux)
 (initrd microcode-initrd)
 ;; includes iwlwifi, intel-microcode
 (firmware (list linux-firmware))
 (locale "en_US.utf8")
 (timezone "America/New_York")
 (keyboard-layout (keyboard-layout "us"))
 (host-name "ariadne")
 
 ;; plugdev group, udev support for hardware key
 (groups (cons
	  (user-group
	   (name "plugdev")
	   (system? #t))
	  %base-groups))

 ;; The list of user accounts ('root' is implicit).
 (users (cons*
	 (user-account
          (name "kjhoerr")
          (group "users")
          (home-directory "/home/kjhoerr")
          (supplementary-groups '("wheel" "netdev" "audio" "video" "kvm" "plugdev" "docker")))
	 %base-user-accounts))
 ;; system packages - user applications can be handled by Nix
 (packages (append (list 
		    dconf
		    dmidecode
		    emacs
		    emacs-guix
		    file
		    font-fira-code
		    font-awesome
		    font-ibm-plex
		    fwupd-nonfree
		    git
		    gnome-tweaks
		    gnupg
		    gsettings-desktop-schemas
		    inetutils
		    neovim
		    nix
		    nss-certs
		    pfetch
		    pinentry
		    unzip
		    zip)
		   %base-packages))

 ;; Below is the list of system services.  To search for available
 ;; services, run 'guix system search KEYWORD' in a terminal.
 (services (append (list
		    (bluetooth-service #:auto-enable? #t)
		    (service gnome-desktop-service-type)
		    (service cups-service-type)
		    (service docker-service-type)
		    (service fprintd-service-type)
		    ;; hardware key
		    (service pcscd-service-type)
		    (service syncthing-service-type
			     (syncthing-configuration
			      (user "kjhoerr")))
		    (service nix-service-type)
		    ;;(shepherd-service
		    ;;  (documentation "Configure dconf for Wayland.")
		    ;;  (requirement '(user-processes))
		    ;;  (one-shot #t)
		    ;;  (start #~(if [ -z "$(dconf read /org/gnome/mutter/experimental-features)" ]; then dconf write /org/gnome/mutter/experimental-features "['scale-monitor-framebuffer']"; fi)))
		    )

		   (modify-services
		    %desktop-services
		    ;; enable substitute for nonguix - should help with large packages, i.e. linux, firefox
		    (guix-service-type config =>
				       (guix-configuration
					(inherit config)
					(substitute-urls
					 (append (list "https://substitutes.nonguix.org")
						 %default-substitute-urls))
					(authorized-keys
					 (append (list (plain-file "non-guix.pub" "
              (public-key 
                (ecc 
                  (curve Ed25519)
                  (q #C1FD53E5D4CE971933EC50C9F307AE2171A2D3B52C804642A7A35F84F3A4EA98#)
                  )
                )"))
						 %default-authorized-guix-keys))))
		    ;; enable wayland for gdm, gnome
		    (gdm-service-type config =>
				      (gdm-configuration
				       (inherit config)
				       (wayland? #t)))
		    ;; hardware key support
		    (udev-service-type config =>
			   	       (udev-configuration
					(inherit config)
					(rules (cons libu2f-host
						     (udev-configuration-rules config))))))))
 (bootloader
  (bootloader-configuration
   (bootloader grub-efi-bootloader)
   (targets (list "/boot/efi"))
   (keyboard-layout keyboard-layout)))
 (mapped-devices (list
		  (mapped-device
		   (source (uuid "25b23653-1001-499e-bf04-0e6b7ecd469d"))
		   (target "cryptroot")
		   (type luks-device-mapping))
		  (mapped-device
		   (source (uuid "6f030b55-0da0-446e-8a92-59beec2b1118"))
		   (target "crypthome")
		   (type luks-device-mapping))))

 ;; The list of file systems that get "mounted".  The unique
 ;; file system identifiers there ("UUIDs") can be obtained
 ;; by running 'blkid' in a terminal.
 (file-systems (cons*
		(file-system
		 (mount-point "/")
		 (device "/dev/mapper/cryptroot")
		 (type "btrfs")
		 (dependencies mapped-devices))
		(file-system
		 (mount-point "/home")
		 (device "/dev/mapper/crypthome")
		 (type "btrfs")
		 (dependencies mapped-devices))
		(file-system
		 (mount-point "/boot/efi")
		 (device (uuid "8108-7268" 'fat32))
		 (type "vfat"))
		%base-file-systems)))

In order to get fractional scaling to work, you need to run dconf write /org/gnome/mutter/experimental-features "['scale-monitor-framebuffer']". Then on relogging you should be able to select that beautiful 150% (or whichever is your preference) in Display settings. Eventually I’ll get that fixed in the config.

Fingerprint for some reason isn’t working at login, but I have been able to register them in Gnome settings. I probably just need to wipe out the fingerprint database from the last time I used it.

Haven’t gotten lvfs working either. Still trying to find if there’s some configuration I need that I haven’t added yet, there’s not much in documentation about it yet.

Wifi, touchpad, mic, webcam, speakers all work splendidly out of the box. I was able to connect to my mouse via bluetooth as well.

2 Likes

@kjhoerr This is wonderful! Thank you for the update. I guess time to clear the clutter on my machine and make some space for GUIX and dual boot for a while.

1 Like

Did a guix pull and reconfigure today and the fprint issue rendered me unable to log in via GDM, just instantly kicks me back to the user select screen whenever I try to log in, even with fingerprint disabled in user settings.

I may run a liveusb to try sideloading the fprint db clear script I’ve seen floating around on these forums, but for now I just removed the fprintd-service-type spec in the config. I see from a mailing list there’s a new fprintd-configuration spec, but that hasn’t even reached the dev manual yet so not sure how to tweak it. If anyone else gets it working let me know.

I figured out you can use fwupdtool just fine, sees all the devices and can refresh and update. The problem is you can’t enable the lvfs-testing remote, since that only works via the fwupdmgr command. This problem will hopefully eventually become moot once Framework updates move to the stable remote.

2 Likes

@kjhoerr Regarding your config, would you mind helping me with the (xorg-config (extra-config)) form? I’m trying to get my touchpad to let me tap to click, but when I do, the display manager (I think it’s SLiM or GDM or whatever the default was when I installed i3) completely fails to load. It just gets to the black terminal login prompt and then hangs.

My config is located here: debian Pastezone , I’ve made some minor modifications after reading the arch wiki and trying to get help from the guix IRC channel, but with no luck on this part, unfortunately :frowning: So I was hoping someone else with a framework machine could help me get this fixed up. I’m on a 12th gen model, if it helps.

Thanks for any help you can spare, I greatly appreciate it.

1 Like

It’s difficult to find good examples of this, I end up spending a lot of time googling for “system.scm | config.scm” or something of the like just to see how people use it. Scheme definitely isn’t easy for beginners :upside_down_face:

I apologize that I’m reaching in the dark here, I’m more wayland only per my config. It looks like the service definition you’re using is a procedure, which I’m not very familiar with. Based on the documentation I think you should be able to do this:

EndSection"
				))
		    (keyboard-layout keyboard-layout)) gdm-service-type)) ;; or whichever display manager service-type 

           ;; This is the default list of services we
           ;; are appending to.
           %desktop-services)

This is part of the set-xorg-configuration procedure definition.

Alternatively you could go the more traditional route using modify-services instead:

    (modify-services %desktop-services
		     (gdm-service-type config => (gdm-configuration
						   (inherit config)
						   (xorg-configuration 
		(extra-config '("Section \"Device\"
				Identifier \"Intel Graphics\"
				Driver \"intel\"
				Option \"AccelMethod\" \"sna\"
				EndSection"

				"Section \"Device\"
				Identifier \"0x43\"
				Driver \"intel\"
				Option \"Backlight\" \"intel_backlight\"
				EndSection"
				
				"Section \"InputClass\"
				Identifier \"Touchpads\"
				Driver \"libinput\"
				MatchIsTouchpad \"on\"
				Option \"DisableWhileTyping\" \"on\"
				Option \"Tapping\" \"on\"
				Option \"MiddleEmulation\" \"on\"
				EndSection"
				))
		    (keyboard-layout keyboard-layout)))))
2 Likes

This is my current basic config, maybe you find it useful, its gnome+wayland, got some ideas from @kjhoerr config and others:

3 Likes

Non-update that may turn into an update: I picked up an Ath 9462 from ThinkPenguin and installed it in my 11th-gen. My NixOS install has reached a great point so I’m thinking about dual booting Guix and see if I can avoid using nonguix since I won’t have the iwlwifi driver module dependency and the ath drivers are blobless. Will post here if I make any progress.

2 Likes

This is an interesting thread, following. :slight_smile:

I’m using Guix System as my primary (only) OS on the Framework with the non-free kernel and firmware.

Almost everything works fine. Some things like iio-sensor-proxy are not packaged at the moment so the auto-brightness doesn’t work. The fingerprint daemon was buggy when I’ve created my config so I’ve disabled that. It might work now.

3 Likes

@Rick_Huijzer would you mind sharing your configuration?

@5uie1 I won’t mind but I’ve got to substitute a lot of private parts that might jeopardize my privacy. And without this (/etc/host rules, some employer specific proprietary packages, network mounts with my IPv4 in it) it’s almost the standard gnome config.

It’s also a bit cluttered with multiple inherit rules from a base configuration which is the same for all my machines so it might be a bit hard to read.

I’ve got a custom dwm config with all kinds of bells for my workstation, but it isn’t optimized for laptop use yet. I also want to transition to wayland so I probably will create a completely new config in the coming months. That one will be shared on my gitlab.

1 Like

Got Guix installed again and wrestled with my configs for a bit to get my Nix home-manager configuration and my pre-existing Guix config to work together. Had some trouble with my yubikey being seen by GPG for git and ssh but that’s fixed now. KeePassXC still won’t read it without sudo permissions. I’ve fiddled with the udev rules quite a bit by this point so I’m not sure what the issue is, and it’s an issue I’ve had before, in Guix specifically.

The Ath 9462 works pretty well even with linux-libre, all except for bluetooth with is universally nonfunctional for libre or requires some blobs to run, if I’m correct. It’s probably slower than the AX210 chips but for my day to day use it’s unnoticeable.

My Guix config for my framework laptop sits perpetually over here now if anyone wants to reference. Some of my fixes ended up being from my home-manager setup which is in the same repo.

I’ve gone LUKS-less this time. I can’t live without Secure Boot and TPM unlocking anymore :face_in_clouds: I may transition back to NixOS pretty quickly and just do a Guix VM. I want to try to get impermanence set up in Guix, but it’ll be a lot of work…

3 Likes

Managed to get wifi working on the Framework 13 AMD Ryzen 7040 but looks like the non-free kernel from nonguix doesn’t include the driver for RZ616/MT7922 adapter by default.

To add the required modules use a custom kernel based on linux-libre-6.6

(define-public linux-fw13
  (corrupt-linux linux-libre-6.6
                 #:name "linux-fw13"
                 #:configs '("CONFIG_MT7921E=m")))

then in the operating-system declaration…

 (kernel linux-fw13)

after reconfiguring the system, check if the module is available with modinfo mt7921e

2 Likes

You can switch back to nonguix’s plain linux kernel if you like, the patch enabling the driver has now been merged and doesn’t require any extra configuration.

I set (non)Guix up on my 13 AMD yesterday with GNOME and it’s running beautifully. The one sticking point is that shutdown and reboot actions don’t seem to work, as they cause the system to just hang on a blank cursor. But I’ve heard this is common on other Guix machines as well.

1 Like

sounds good. are you using any specific kernel-arguments or firmware declarations?

with 6.6 i needed to add this to get screen dimming and keyboard backlight working
(kernel-arguments '("modprobe.blacklist=hid_sensor_hub"))

…and this seems like overkill, but works (firmware (list linux-firmware))

my current system config can be found on gitlab
https://gitlab.com/zzkt/guix/-/blob/endless/config/framework13-system.org

I went for the overkill option and am using (firmware (list linux-firmware)) too. Later I want to just limit it to the firmware the Framework needs, but figuring out which ones those are is very low priority for me right now.

As for kernel arguments, nothing special, just this one I saw on Arch Wiki about setting the wireless regulatory domain:

 (kernel-arguments
  (append
   (list
	 "cfg80211.ieee80211_regdom=US")
   %default-kernel-arguments))

To be honest, I hadn’t even noticed that the Framework has a keyboard backlight until now, but it seems to be working for me without your kernel option.

I just upgraded to nonguix linux-6.7 (currently based on linux-libre-6.7.2) with the most recent linux-firmware and it looks like everything is working fine without any extra config options.

so the kernel options might be needed for earlier kernels but appear unnecessary now.

1 Like

It looks like this is caused by shepherd waiting indefinitely for a mt7921e kernel thread to end. It’s not very elegant, but you can shutdown or reboot with rmmod mt7921e && shutdown or some variation of that.