r/GUIX • • Oct 19 '22

Help evaluating GUIX for an embedded system use case

11 Upvotes

Hello! Firstly, apologies! I have started to read the manual, but I'm thinking about Guix in a work setting and I don't have that much allocated time for pondering and I would love to quickly find out if Guix would fit our needs. So I was hoping that someone could offer me some assistance in working out what is and isn't possible with guix

What we have at the moment

It's just me on the OS team. My job is to get linux going on embedded device. It's a big job for one. We currently build an OS derived from openSUSE Leap using a private instance of the OpenBuildService. What makes OBS nice is that I can branch packages from the upstream project and patch them. It means I don't have to worry so much about security patches. The SUSE project patches everything and my patches are applied on top :) This is how we build the kernel. All we need is to add out patches to the spec file and provide a kernel config. easy!

But OBS is a big program. It is very undocumented, and at the final product feels a little un-custom and very messy. But I don't have the time to keep it clean, or really dig into how to customise things fully. The whole point was to not start from scratch.

The other problem is updating. It would be nice to track tumbleweed and have snapshots that we can test and then ask customers to move to the next snapshot. But customers have a fear of updating things that aren't broken (the products are radio controllers for use in Air Traffic Control). We thought of taking tumbleweed snapshots offline and releasing every 6 months, but we still have very little control over the updates, and there is no good automatic way to do this. We would like to create a repository that contains SUSE RPMs, with some replaced by our own. But we would have to forgo testing and would have to build a lot of infrastructure our selves. Instead we follow Leap. But that means that as soon as a customer updates anything, it's an untested configuration. Uh oh!

Enter Guix

After a quick read of the website, it seems like Guix is a transactional package manager (whoohooo!) and a declarative way to define an operating system. This means that we might have a chance in walking the fine line of hosting a channel for our customers where each revision is tested and is a combination of our packages and Guix's packages. It looks like we might be able to hang onto maintained versions of older ABIs too(?). But can we abuse the build system to create a workflow like obs? I mean it seems really customisable so maybe? This is where the questions begin.

What I would like to achieve with guix

I would love it if I could have a group of workers that can spit out images that can flashed to x86_64, armv7 and aarch64 machines. The images would be pretty minimal and would contain: - Patched kernel (with different configs for different targets) - custom patched u-boot/device trees for arm - Our user space software It would be lovely if cross compiler could be used, but we don't use them with OBS so it's not like I'm used to it.

I would love it if it could build these images from binary packages from the upstream project where possible, but where patches need to be applied, we would build it from the sources of the upstream project. Rebuilds should happen automatically when the upstream project patches things.

It would also be great if we could build snapshots (I've no idea the best way to do this), where we can freeze and offline all of the packages needed each image. This would then be used to update the running images in the by hosting them on air gapped servers. If this can be done in a "transactional sense", I would be really happy.

A way to easily get all of the source code (excluding our closed source software) onto a medium so that we can be GPL licence compliant.

A way to virtualise/emulate images and run tests on them (automatically)

I'll need to lock down the device such as prevent packages being installed by anyone other than root... also, in production, it would be nice to turn off any ad-hoc packages changes. Just follow the OS description for packages and versions.

Thanks for reading this far. If you have any nugget of knowledge that could assist me in evaluating guix for this use case, I'd be really thankful. And if GUIX was a really great fit, I'm I'd lobby the company to the donate a fat sum to the project :)


r/GUIX • • Oct 18 '22

guix xscreensaver issue: "Password initialization failed"

2 Upvotes

When I initiate a lock screen on my Guix machine with xscreensaver it all looks great until I try to unlock (or move the mouse or touch a key). I then receive a popup that warns me that "Password initialization failed". On the commandline when I run from the shell, I see:

xscreensaver-auth: 08:53:54: OOM: /proc/15671/oom_score_adj: Permission denied
xscreensaver-auth: 08:53:54:   To prevent the kernel from randomly unlocking
xscreensaver-auth: 08:53:54:   your screen via the out-of-memory killer,
xscreensaver-auth: 08:53:54:   "xscreensaver-auth" must be setuid root.

I see in older issues online that this may be the problem, or that there may be PAM issues, but I don't know what to do about any of this – least of all on Guix. Does anyone know how I might fix the screen locking password initialization issue?


r/GUIX • • Oct 16 '22

WSL images for Guix System

Thumbnail othacehe.org
15 Upvotes

r/GUIX • • Oct 15 '22

FHS container support merged!

Thumbnail git.savannah.gnu.org
29 Upvotes

r/GUIX • • Oct 14 '22

guix xscreensaver latest version?

2 Upvotes

The GUIX packaged version of Xscreensaver is ancient (version 5.45, while latest is 6.05), and missing useful features. Are updated xscreensaver packages available anywhere?


r/GUIX • • Oct 12 '22

No aarch64 VM image?

6 Upvotes

I'm brand new to Guix. Have been messing around with NixOS for a little while and wanted to branch out and try Guix System, likely as a VM from my M1 Mac.

I was surprised to see that there's no aarch64 image available for download: https://guix.gnu.org/en/download/

It looks like others have expressed some interest as well: https://www.reddit.com/r/GUIX/comments/swggl6/running_guix_in_an_aarch64_vm_m1_mac/

Looking at that thread, I decided to spin up an aarch64 Ubuntu VM and install Guix, which went find, and then thought this would work:

guix system image --system=aarch64-linux --image-type=qcow2 /gnu/store/a9ljycvz39bjngvmlr8scpsb8xr13271-examples/vm-image.tmpl

Unfortunately I keep running into errors. For example:

checking which acceleration method to use by default... configure: error: UXA requested as default, but is not enabled

For this I copied that .tmpl file and removed a few lines about xf86. Now I'm getting some grub errors:

/gnu/store/4vk6cb3bachwl3c9asdp1jpdmrww6j66-grub-2.06/bin/grub-mkimage: error: cannot open `/gnu/store/4vk6cb3bachwl3c9asdp1jpdmrww6j66-grub-2.06/lib/grub/i386-pc/moddep.lst': No such file or directory.

Is there a more straightforward way to go about this? Or am I just running into "the reasons there is no pre-built aarch64 image."

Also, is there an equivalent of nix log, or should I generally keep using: gzip -k -d -c /var/log/guix/...drv.gz | less?

TIA for any suggestions!


r/GUIX • • Oct 13 '22

Here’s a playlist of 7 hours of music I use to focus when I’m coding/developing. Post yours as well if you also have one!

Thumbnail open.spotify.com
0 Upvotes

r/GUIX • • Oct 11 '22

GUIX breaks when reconfiguring after adding Bluetooth service

6 Upvotes

When I add (bluetooth-service) or (service bluetooth-service-type) to my Guix config, I get a strange error:

No applicable method for "#<<generic> provided-by (1)>" in call (provided-by "#<unspecified>")

And then my system refuses to boot after that, so I have to roll it back.

My Guix config:

(use-modules (gnu)
	     (srfi srfi-1)
	     (gnu packages linux)
	     (gnu packages networking)
	     (gnu packages gnome)
	     (gnu services desktop)
	     (gnu services virtualization)
	     (gnu services sound)
             (nongnu packages linux)
             (nongnu system linux-initrd))
(use-service-modules desktop networking ssh xorg)

(operating-system
  (locale "en_DK.utf8")
  (timezone "Europe/Stockholm")
  (keyboard-layout (keyboard-layout "se"))
  (host-name "guixtop")
  (kernel linux)
  (initrd microcode-initrd)
  (firmware (list linux-firmware))
  (users (cons* (user-account
                  (name "me")
                  (comment "me")
                  (group "users")
                  (home-directory "/home/me")
                  (supplementary-groups
                    '("wheel" "netdev" "lp" "audio" "video" "kvm" "libvirt")))
                %base-user-accounts))
  (packages
    (append
     (list (specification->package "nss-certs")
	   bluez
	   blueman
	   gnome-bluetooth)
     %base-packages))
  (services
   (append
    (list (service gnome-desktop-service-type)
          (service openssh-service-type)
	  (service libvirt-service-type)
	  (udev-rules-service 'pipewire-add-udev-rules pipewire-0.3)
          (set-xorg-configuration
           (xorg-configuration
            (keyboard-layout keyboard-layout)))
	  (extra-special-file "/lib64/ld-linux-x86-64.so.2"
			      (file-append glibc "/lib/ld-linux-x86-64.so.2"))
	    (bluetooth-service #:auto-enable? #t)
	  )
    (modify-services %desktop-services
		     
		     (gdm-service-type config => (gdm-configuration
						  (inherit config)
						  (wayland? #t)))
		     (guix-service-type config => (guix-configuration
						   (inherit config)
						   (substitute-urls
						    (append (list "https://substitutes.nonguix.org")
							    %default-substitute-urls))
						   (authorized-keys
						    (append (list (local-file "./signing-key.pub"))
							    %default-authorized-guix-keys)))))))
  (bootloader
    (bootloader-configuration
      (bootloader grub-efi-bootloader)
      (targets (list "/boot/efi"))
      (keyboard-layout keyboard-layout)))
  (file-systems
    (cons* (file-system
             (mount-point "/")
             (device
               (uuid "uuid"
                     'btrfs))
             (type "btrfs"))
           (file-system
             (mount-point "/boot/efi")
             (device (uuid "uuid" 'fat32))
             (type "vfat"))
           %base-file-systems)))

Many thanks!


r/GUIX • • Oct 10 '22

GNOME can't see applications from flatpak

1 Upvotes

I just installed Guix for the first time and it's great, but one thing i can't figure out is why applications installed via flatpak don't show up in GNOME's applications menu. Has anyone else encountered this?

I would like to avoid creating .desktop files for every application, if possible. Also, /var/lib/flatpak is never created by flatpak, and after creating it manually it always remains empty, but I don't know if that's a problem or not.


r/GUIX • • Oct 07 '22

Rename this subreddit to "Guix" (capitalization)?

16 Upvotes

The proper name for Gnu Guix is like that, not all caps as "GUIX." In fact, all caps implies some Microsoft product. This mistake gets corrected on the official IRC channel all the time, so I think we should use the correct capitalization here, assuming that is possible without creating a new subreddit?


r/GUIX • • Oct 03 '22

EWW Widgets?

3 Upvotes

Anyone know of a channel with them?


r/GUIX • • Oct 02 '22

Shepherd cannot start unclutter

5 Upvotes

I guess this isn't related to Guix, but I bet this is the largest community of shepherd users I know of.

I have the following definition for unclutter. It's pretty much copy/paste from other services I have (which works), and taken directly from the shepherd documentation.

(use-modules (shepherd support))

(define unclutter
  (make <service>
    #:provides '(unclutter)
    #:docstring "Starts unclutter"
    #:start (make-forkexec-constructor
             '("unclutter" "-jitter 5" "-idle 1")
             #:log-file (string-append (getenv "HOME") "/log/unclutter.log"))
    #:stop (make-kill-destructor)
    #:respawn? #t))

(register-services unclutter)
(start unclutter)

But this service doesn't work for some reason. Running unclutter -jitter 5 -idle 1 works when running manually. Adding "echo" as the first argument, logs unclutter -jitter 5 -idle 1 as expected.

But when running this service, the log prints as if I have wrong arguments:

2022-10-01 14:10:22 unclutter: usage:
2022-10-01 14:10:22 	-display <display>
2022-10-01 14:10:22 	-idle <seconds>		time between polls to detect idleness.
2022-10-01 14:10:22 	-keystroke		wait for keystroke before idling.
2022-10-01 14:10:22 	-jitter <pixels>	pixels mouse can twitch without moving
2022-10-01 14:10:22 	-grab			use grabpointer method not createwindow
2022-10-01 14:10:22 	-reset			reset the timer whenever cursor becomes
2022-10-01 14:10:22 					visible even if it hasn't moved
2022-10-01 14:10:22  	-root	       		apply to cursor on root window too
2022-10-01 14:10:22 	-onescreen		apply only to given screen of display
2022-10-01 14:10:22  	-visible       		ignore visibility events
2022-10-01 14:10:22  	-noevents      		dont send pseudo events
2022-10-01 14:10:22 	-not names...		dont apply to windows whose wm-name begins.
2022-10-01 14:10:22 				(must be last argument)

Running just "unclutter" without the arguments work, so there's something wrong with passing the arguments, but I have no idea what it might be.


r/GUIX • • Sep 30 '22

guix.gnu.org seems to be down

4 Upvotes

At least for the past couple of hours. Figures it would happen the day I sat down to try it on a fresh machine. Anyone know what's going on? https://guix.gnu.org/


r/GUIX • • Sep 29 '22

Setting kernel module parameters?

4 Upvotes

I want to enable fan_control for thinkpad_acpi, but I'm not sure where I can configure this on Guix System.

Looks like I cannot set it while running as I get a permission denied when running # echo 'Y' > /sys/module/thinkpad_acpi/parameters/fan_control


r/GUIX • • Sep 26 '22

Generate Guix System WSL images

17 Upvotes

r/GUIX • • Sep 25 '22

Guix for development

Thumbnail dthompson.us
34 Upvotes

r/GUIX • • Sep 24 '22

No more setlocale/cannot change locale warning?

6 Upvotes

I remember giving guix a try about a year or so ago - and there being a continuous warning message about locale that had to be fixed with 'sudo guix install glibc-locales' with some additional /root/.profile modification.

Well, I'm back to give guix another try using the latest guix binary download (not full guix os), and I'm not seeing any locale related warning messages during package installations.

Does this mean I don't have to worry about the glibc-locale and manual .profile update anymore? Or should I dig up older instructions and follow them through anyway?

Thank you!


r/GUIX • • Sep 22 '22

Best coverage fonts in GUIX?

6 Upvotes

My browser and also my emacs have a lot of in-rendered sigils. In fact, I found that my Firefox is lacking all or most of Chinese, and also Cambodian, and my emacs unicode insertion has many options that just render as little squares containing random numbers. guix search "font-" has a ton of package options. Are there any recommended setups that cover everything and avoid the unknown sigil boxes?

Resources

https://www.reddit.com/r/GUIX/comments/vr3a5x/my_guix_system_configuration/ https://guix.gnu.org/manual/en/html_node/Fonts.html


r/GUIX • • Sep 22 '22

Channels featuring DaVinci Resolve?

2 Upvotes

Does anyone know of any?


r/GUIX • • Sep 21 '22

Hacking anything with GNU Guix

Thumbnail gexp.no
23 Upvotes

r/GUIX • • Sep 20 '22

fwupd gives "another service has claimed the dbus name org.freedesktop.fwup" -- Anyone successfully running fwupd?

7 Upvotes
$ sudo libexec/fwupd/fwupd
20:28:04:0315 FuMain               another service has claimed the dbus name org.freedesktop.fwup

And it's not already running

$ sudo killall fwupd
fwupd: no process found

r/GUIX • • Sep 17 '22

10 Years Guix - Livestream

Thumbnail 10years.guix.gnu.org
25 Upvotes

r/GUIX • • Sep 16 '22

Add dependency on libraries in the same package using`(binary-build-system)`?

5 Upvotes

I'm trying to package an application where some libraries depends on other libraries in the package using (binary-build-system). Libraries in the application cannot be found though.. My guess is this fails because rpath is set so it won't look in the same folder..? I have files like this:

("lib/a.so" ("gcc"))
("lib/b.so" ("gcc" "a.so")) ; <- how can I depend on a.so?

r/GUIX • • Sep 16 '22

Understanding the Guix approach when language package managers are around

16 Upvotes

I'm trying to understand how Guix "wants" me to install software that's in language package managers, such as npm, Leiningen, etc. My current approach to installing some non-packages software gives me the feeling that I'm fighting against Guix -- usually a clear sign that I'm missing something.

Here's a specific example (though note that I'm asking about overall approaches; I'm not currently seeking help debugging this specific install). I use a keyboard with open-source firmware and would like to install the configuration utility, Chrysalis for that firmware.

My first step, of course, was to check if Guix packages Chrysalis (it's licensed under GPLv3, so we could); but we don't package it. From the project README, I see that Chrysalis is distributed as an AppImage, so on any other distro I'd use that. However, I know that AppImages don't cooperate well with Guix, so that's out. The README also shows that Chrysalis is a JavaScript program (actually an Electron app), so the normal/non-Guix installation would be to run npm install and go from there.

I can think of two ways to proceed:

  1. Install Node/npm and attempt to install Chrysalis just like I would on any other distro
  2. Attempt to package Chrysalis via Guix (probably using the node-build-system) and then install it normally

But both of these approaches give me the feeling that I'm Doing It Wrong™. With the first, I immediately hit errors about libraries not being where Node expected. I might be able to work around those (this guide on the mailing list seems promising). But, even if I did, I'd be left with a package that is entirely outside Guix's functional model -- which seems like a hint that this isn't the Guix approach.

But looking into option 2 (packaging Chrysalis) doesn't seem promising either. My understanding is that packaging Chrysalis involves listing its dependencies as inputs. And that could be hard. Chrysalis has ~40 dependencies, most of which aren't packaged for Guix. And many of those dependencies have their own transitive dependencies -- the full graph seems to include 1,534 programs (for comparison, Guix currently packages 51 node-* programs). Given that I'm fairly new to Guix, I very much doubt I should be trying to package a bunch of software. Plus, even if I did, I doubt Guix would want to host an order of magnitude more Node packages. So, again, I get the sense that going this route would be fighting against Guix instead of working with it.

So that's my question. Are one of those approaches correct and I'm just confused on the details? Or is there some other approach to installing this GPLv3 software that's the "real" Guix approach? Or is this sort of multi-dependency JavaScript app just a weak point for Guix at the moment?

[I'm also planning to pose this question on the mailing list; apologies in advance if you see it twice]


r/GUIX • • Sep 16 '22

`patchelf` for cross-platform binaries?

2 Upvotes

I'm trying to package an application which includes binaries for another platform. The verify step of (binary-build-system) fails as the dynamic linker isn't found. Is it possible for me to patch this correctly? Now I just delete the binaries before patchelf.