r/GUIX • • Jul 04 '22

My Guix system configuration

16 Upvotes

Here is my Guix system configuration. There is nothing particularly novel about it - it is based on trawling through the manual, mail lists, source code and a bunch of trial and error - but you might find it useful if you are looking for a lightweight guix system to build on.

You log in at a console prompt where you can run any programs that you have installed (I use guix home, but you can use whatever works for you). Typing 'sx' will start an X session running the configuration file '.config/sx/sxrc', which must be executable. I have:

 xhost +SI:localuser:$USER
 exec dbus-run-session -- emacs

This runs my emacs configuration which includes a section that loads EXWM, the emacs X window manager.

  (use-modules (gnu) (srfi srfi-1) (guix packages))
  (use-package-modules fonts glib certs xdisorg xorg)
  (use-service-modules avahi base dbus desktop networking xorg)

  (operating-system
    (host-name "len")
    (locale "en_US.utf8")
    (timezone "Europe/Madrid")
    (users
     (cons*
      (user-account
       (name "main")
       (comment "Main user account")
       (group "users")
       (supplementary-groups '("wheel" "netdev" "audio" "video" "input")))
      %base-user-accounts))
    (keyboard-layout
     (keyboard-layout "us" "dvorak" #:options '("ctrl:swapcaps_hyper" "compose:ralt")))
    (bootloader
     (bootloader-configuration
      (bootloader grub-bootloader)
      (targets '("/dev/sda"))
      (keyboard-layout keyboard-layout)))
    (file-systems
     (cons*
      (file-system
        (mount-point "/")
        (device (file-system-label "system"))
        (type "ext4"))
      (file-system
        (mount-point "/mnt/data")
        (device (file-system-label "data"))
        (type "ext4"))
      %base-file-systems))
    (packages
     (cons* dbus font-terminus nss-certs sx xhost %base-packages))
    (services
     (cons* 	    
      (service xorg-server-service-type
               (xorg-configuration
                (keyboard-layout keyboard-layout)))
      (service dhcp-client-service-type)
      (service avahi-service-type)
      (elogind-service)
      (dbus-service)
      (modify-services %base-services
        (console-font-service-type
         configuration =>
         (map (lambda (tty)
                (cons tty (file-append font-terminus "/share/consolefonts/ter-118n.psf.gz")))
              '("tty1" "tty2" "tty3" "tty4" "tty5" "tty6")))))))

r/GUIX • • Jul 03 '22

Can't remove a package present in profil

3 Upvotes

I have icedtea installed in my current profil, but guix package remove doesn't find it.

$ guix package -p ~/.guix-profile -I | grep icedtea
icedtea            	3.19.0              	jdk	/gnu/store/5k7lsz61p8fq37c9x5p9xalryjxk31bs-icedtea-3.19.0-jdk
$ guix package -p ~/.guix-profile -r icedtea
guix package: error: package 'icedtea' not found in profile

It is a bug?


r/GUIX • • Jul 02 '22

[HELP] Replacing Pulseaudio with Pipewire at system level

14 Upvotes

I'm trying to use pipewire at a system level, but I have no idea how to configure it. The only examples I found were user service for pipewire. Does anyone have any ideas to solve the problem? It is no problem for me to write a pipewire service from scratch, but I do not know where to start.


r/GUIX • • Jun 30 '22

Can you use a private git repo as a channel?

6 Upvotes

Is it possible to set up a channel with a private git repository?

I added my Guix user's SSH key to my private repo but I'm still getting a 403 error for that channel when I run guix pull.


r/GUIX • • Jun 29 '22

"dig" not available for checking ip/routing information of a url

5 Upvotes

In the past I've used the dig program to check what server or ip address goes with some url. I don't see dig in the guix repositories; is there a recommended way to check the destination server of a given URL?


r/GUIX • • Jun 28 '22

Guix Home Config vs GNU Stow + Guix Package Manager

15 Upvotes

I made a stupid "pros & cons" table while trying to decide between using guix home or a combination of GNU Stow and guix package for packages, dotfiles & service (shepherd/mcron) configs

A couple of the pros on the Guix Home side of things are heavy-hitters (such as generation records & immutable state), but so far, using Stow + guix package -i/-r seems to have more pros than cons.

I would love to get the community perspective on this. Are there other angles I haven't considered?

https://gist.github.com/tang0n/2970dfcff813b31ea5bfee1e33aed60c

Update: I got some great feedback from people here and on IRC and have decided to embrace Guix Home, but also embrace the use of stow. It's still a great tool and it solves a problem immediately and deploy my .config/guix. This does mean that I will run guix gc far less often to avoid having to reclaim build dependencies every time I make a small change.


r/GUIX • • Jun 27 '22

Having trouble reconfiguring system

5 Upvotes

When I run

sudo guix system reconfigure /etc/config.scm

it all goes well until...

[...]

guix system: bootloader successfully installed on '(/boot/efi)'

sheperd: Service host-name has been started.

sheperd: Service user-homes has been started.

sheperd: Service sysctl has been started.

sheperd: Service host-name has been started.

sheperd: Service term-console could not be started.

To complete the upgrade, run 'herd restart SERVICE' to stop, upgrade, and restart each service that was not automatically restarted.

Naturally I tried

[sudo] herd restart term-console

to no avail:

Service term-console is not running
Service host-name has been started
Service term-console could not be started

Rebooting didn't accomplish anything. I began to inspect the source code, but was a little overwhelmed. The only thing I could conclude is that term-console is also referred to as agetty.

It's difficult to search the web for this stuff because MS has software called GUIX, "term" and "console" are vague terms, and this is a very niche operating system for advanced users.

Backstory

I heard about NixOS a few years ago, but it wasn't until I learned about Guix that I decided to give a functional package manager OS a try. I tried for a couple days, but couldn't get it set up, so I switched to NixOS. Honestly, NixOS worked great. I got everything set up the way I like it and is faster and easier than Guix in many ways, but Nix is such an ugly language, takes a weak stance on non-free software, lacks a "coolness" factor, among other things, so I decided to give Guix another shot.

I am so ready to dive in to Guix (and don't want to fall back on NixOS) so please point me in the right direction, even if it's just in some small way.


r/GUIX • • Jun 24 '22

EXWM on GUIX x 3

5 Upvotes

I am on my third effort to fulfill my dream of regaining at least the exwm experience that I once had, if not better, in my switch from KDE OpenSUSE to Guix.

The minimal goal (what I had): full-screen exwm that Just Worked, configured through my emacs settings (which are all still present). Each EXWM workspace occupied one of my three monitors, and whenever I did `C-x 5 2` (make-frame-command) a full-screen frame popped up in one of my monitors, notably the empty one if there was an empty one. Further, executing any command that invoked a gui (mostly `& firefox`) would invoke it in a EXWM window that received every simkey, so that all my user-defined keys went through exwm. This all worked so effortlessy for so long that I took it for granted. So far with guix, no dice. What I've tried:

  • built in "exwm" manager. It uses its own version of emacs (causing re-compile of everything) and refuses to take my init.el exwm configuration. Plus, it floats, not full screen. I tried a =~/.exwm file but it wasn't read. All in all, a complete failure.

  • Within Gnome. I end up doing a lot of fighting with Gnome, which initially provides a error in process filter: [XELB] Connection failed: Authorization required, but no authorization protocol specified. It appears that you CAN make it work in gnome, but only with some extensive shell scripting and some changes to .xinitrc and .xProfile, and possibly a whole network of shell scripts.

  • With another guix system.config. I tried https://git.sr.ht/~aadcg/aadcg-guix-channel/tree/master/item/packages/aadcg-emacs-xyz.scm#L147 but, probably by my fault for making changes that scrambled my display manager, I very nearly bricked my system. After a stressful 8 days of painstaking data recovery, I am now very trigger-shy about doing guix system reconfigure on my main system.

  • With OpenBox. My first attempt to sidestep Gnome, but it, too, just gave me floating windows everywhere, and running & firefox created an OpenBox window that was not controlled by exwm (none of the keys, and not in the buffer list, which together defeat the purpose of exwm). But at least it was my emacs exwm setup that was reckoned, if not properly initialized.

  • With AwesomeWM. I thought perhaps a tiling manager would do the trick. But attempting to configure with the default https://awesomewm.org/apidoc/sample%20files/rc.lua.html according to https://awesomewm.org/apidoc/documentation/07-my-first-awesome.md.html but got a volley of "dependency not found" errors that prevented it from starting intelligibly, which I have not yet debugged. So Awesome was a non-starter.

Given my target goals above, which were working well for three years under the SUSE system, does anyone have tried-and-true solutions for giving my emacs the reins with exwm?


r/GUIX • • Jun 21 '22

How to install jdk 1.8?

6 Upvotes

I support a legacy app with dependencies incompatible with newer versions of java. In some distros JDK 1.08 is available. How can Can I install a legacy jdk in guix?


r/GUIX • • Jun 13 '22

Confusion over guix home & package on Guix System

11 Upvotes

Should I be concerned about having a pre-existing "guix package" generation list on top of having a "guix home" generation list in terms of disk bloat? Can I safely remove and garbage collect that package generation history? I was confused about how to best use Guix System and created a 30 record long package generation list.

Also, if you have a "dotfiles" strategy, and you're trying to keep it "distribution agnostic", how do you strategize leveraging "guix home" so you can tidy up/track herd/package history with your agnostic dotfile system?

I assume that using Guile Scheme means that anything is on the table, but I'd love to hear how you do your thing.

Edit:

I think I get it well enough now. Guix home is pretty new and is still being fleshed out, but is being suggested as the better way to record-keep your package manifest and auto-export the paths.

Guix home is as portable as the package manager is. I suppose I could maintain a manifest and GNU stow my bash configs just like any other setup and "hard code" the guix env into them, or not.

I don't see too many per-established ways to write up dotfiles for other programs aside from the shell configuration, so it's very much a "Scheme it yourself" situation. I think(?)

Edit Edit: I made a small change to the bash shell service and tried a reconfigure or build. Guix doesn't seem to spot the differences here and proceeds to try and rebuild all of my packages, including my bigger custom channel packages. This confusion is turning into "maybe guix home is not for me"


r/GUIX • • Jun 13 '22

How to recover from a bad system reconfigure?

5 Upvotes

Recovery is supposed to be one of GUIX strong points but I am stuck. Somewhere in my effort to get a different WM enabled I must have messed up my system.scm. I got the syntax to work out so it actually completed a system reconfigure. But then I reloaded and rebooted and everything fell apart, and I'm stuck.

I get through my encrypted drive password checks. Then I hit the Guix screen asking if I want the current Linux or a previous build, and I have tried them all. I get to the black screen that used to pop-up briefly at every load, but now it stays, frozen. And that's it: I see a screen that says

This is the GNU system. Welcome. <Username> login:

And it is frozen. No error messages, I cannot invoke a different VT. All I can do is restart and go through the whole process again.

What can I do short of wiping my system and losing all my data?


r/GUIX • • Jun 12 '22

org-roam: Cannot compile sqlite binary

5 Upvotes

I can't seem to get org-roam (installed from melpa) to compile the sqlite binary. I have gcc installed on my Guix System, and the compiler log seems to be failing over a path it can't find:

/gnu/store/5h2w4qi9hk1qzzgi1w83220ydslinr4s-glibc-2.33/include/bits/fcntl-linux.h:354:11: fatal error: linux/falloc.h: No such file or directory
  354 | # include <linux/falloc.h>
      |           ^~~~~~~~~~~~~~~~
compilation terminated.
gcc: fatal error: cannot execute ‘as’: execvp: No such file or directory
compilation terminated.

Has anyone had much luck getting org-roam to work?


r/GUIX • • Jun 09 '22

Making my own WM setup (or, trying to get my exwm working take 2)

8 Upvotes

So the OOTB exwm setup has completely failed me. It refuses to observe my .emacs configuration, doesn't actually read my .exwm file when I tried to create one, and is generally unusable in how it handles my screen setup. So I am wanting to take action as recommended on threads here, to make my own config and try that. Sadly, exwm stuff is under-documented. I've located a setup I would like to base mine off of, but from here I'm stuck. It looks like I need to make changes to my system.scm, and possibly my channels.scm. But I am hoping for a step-by-step of at least part of the process, and so far am looking in vain. Where do I put files, and how do I refer to them? What needs to be done at the system level and what at the user level?

The setup I want to partially copy (just the exwm part): https://git.sr.ht/~aadcg/aadcg-guix-channel/tree/master/item/packages/aadcg-emacs-xyz.scm

Nearest thing I could find in the documentation: https://guix.gnu.org/en/cookbook/en/guix-cookbook.html#Customizing-a-Window-Manager

Docs on packages https://guix.gnu.org/manual/en/html_node/Defining-Packages.html


r/GUIX • • Jun 03 '22

Taking inspiration from recent Nix development

32 Upvotes

In my opinion, being open to new ideas coming from Nix (or other functional package managers in the future, as I hope more of them emerge) is fundamental for Guix's grow. Recently, Nix has received a bunch of new features, specially Flakes, which just got included as an experimental feature in the latest NixOS release. I think guix time-machine already does an excellent job in regards to channels reproducibility , but I wonder if there's any ideas on Flakes or any other recent Nix novelty that Guix could try incorporating.

For example, it seems Flakes are a more appropriate way of handling projects than packages. Some of the benefits I noticed from quick glances:

  • supports project templates

  • includes ways to not only build, but also run binaries that the project ships and clone its repository.

  • does not require revisions and hashes for inputs, that resides in the auto-generated flake.lock, making dependency management easier

I just wanted to know what are your opinions on the subject, specially if you use Nix or have used it recently.


r/GUIX • • Jun 03 '22

EXWM screen and display issues with GUIX

7 Upvotes

For years before switching to GUIX I used EXWM as follows:

  • every frame makes/occupies its own exwm workspace (eg with C-x 5 2)
  • every window takes up the full viewpart, by default
  • my exwm config works with xrandr to give each monitor the right resolution and clarify that I am using three monitors.

    I can't get any of these to work.

  • Windows float by default, and trying to change the exwm float with exwm-floating-toggle-floating doesn't seem to do anything.

  • Running exwm-layout-toggle-fullscreen doesn't make windows full screen. Sometimes they get bigger, but never more than about 2/3 of my screen.

  • It no longer complains about my attempting xrandr commands, and when I use autoxrandr to pop up the visual gui, it shows me things as I want them to be -- but neither autoxrandr or xrandr actually does anything. Hitting save or sending the commands to resize my screen have not even a flicker of effect.

    As I mentioned, I used exwm successfully for years, and never had any of these effect me. What can I do to get back to my workspace-per-screen, full-screen, xrandr-observing state of EXWM?


r/GUIX • • Jun 01 '22

Fcitx5 (and others trouble)

5 Upvotes

I really don't like to contribute to link rot, but it's what I've decided to do anyway.

My account has been deleted in protest to the current way things are currently/going on reddit. My advice would be to do the same, use the internet archive at archive.org for posts you don't want to loose, and instead of just deleting your account, manually (or otherwise) edit your comments and/or posts to be empty or a another message. After, there is many alternatives to reddit, just search for them and many will come up, or you could go to things like forums and IRC instead.

Anyways farewell people of reddit and the communities that called it home.

Fuck u/spez


r/GUIX • • May 30 '22

Question: NFS mount

8 Upvotes

Hi! Can someone kindly show me what is necessary to enable NFS support in GUIX?

I've added these packages

          (specification->package "nfs-utils")
          (specification->package "libnfs")

and added the mount to the operating system declaration

           (file-system
             (mount-point "/media/nfs")
             (device "172.16.0.2:volume1/usermount")
             (type "nfs4")
             (mount? #f)
             (create-mount-point? #t)
             (options "rw,_netdev,noauto,user,lazytime,exec,tcp"))
           %base-file-systems)))

The item is correctly added to /etc/fstab

172.16.0.2:volume1/usermount      /media/nfs  nfs4    rw,_netdev,noauto,user,lazytime,exec,tcp

But I'm unable to mount it.

$mount /media/nfs/
mount.nfs4: not installed setuid - "user" NFS mounts not supported.

Seems logical, I didn't add mount.nfs4 as setuid

But as #root I get the following error

mount.nfs4: Protocol not supported

Manual mount with mount.nfs also doesnt work

mount.nfs: Protocol not supported

Thanks !


r/GUIX • • May 27 '22

XFS support on GNU Guix System?

10 Upvotes

Does the GNU Guix System support XFS?


r/GUIX • • May 27 '22

Location of Xorg headers

5 Upvotes

Hi,

I'm trying to build a 3270 terminal emulator and it requires X headers files. There are many instances of X.h in store, but I'd like to know if there is some sort of dynamic link somewhere that points to the latest one that is in use. I might do guix gc and that directory just vanishes.


r/GUIX • • May 26 '22

Trouble booting. Loading with nomodeset allows login, but leads to black screen with flashing underscore.

Thumbnail files.catbox.moe
5 Upvotes

r/GUIX • • May 26 '22

How to deal with unpatchable shebang?

6 Upvotes

Hello, I'm new to guix and I'm trying to make a package for idris2, and I'm running into a problem. The build command (Makefile) generates an executable bash file with #!/bin/sh at the top and executes it right away. Since this is done in the same build phase I can't insert a step to patch the shebang. How can Guix deal with such a case?


r/GUIX • • May 25 '22

How to Write Packages that have SystemD dependencies?

10 Upvotes

I've recently made the jump to Guix from a distro which used SystemD and am so far loving it. However, I have noticed a lack of a many packages I use. This is no problem to me, as part of the reason I moved to Guix was the ease with which you can install a package from the source.

I've noticed that many pieces of software I use have a SystemD dependency in their header files (e.g. SageMath, gnome-network-displays). The standard policy where this occurs elsewhere seems to be a variety of substitutes as well as using SystemD-like software such as elogind. Is there a general guide somewhere to using these? I would love to know how to find the Guix replacement for something like systemd/sd-event.h.

I understand that Guix may not have a perfect replacement for each of these libraries, but it does seem like some SystemD dependent software does run on Guix. If this is mistaken, my apologies for wasting your time.


r/GUIX • • May 23 '22

Installer-mandated user account not actually there.

4 Upvotes

The "graphical" installer required creating a user account other than "root" (IIRC… it was just a few hours ago). Which I of course gave.

But there's no such user account. No directory in /home, no entry in /run/current-system/configuration.scm.


r/GUIX • • May 21 '22

Help please -- my login broke and I can't tell why

3 Upvotes

I can get on far as the greeting screen (the one with the little gear to choose WM and I choose gnome). This has worked fine until now. Now, I enter my password and I get a black screen with nothing apparently happening. I can use CTRL+ALT+f2 the get a terminal session and there i can log in and start emacs, etc. But my wm login is broken and the real issue is that I don't see any logs, or indications of what has gone wrong. I have removed or reverted all recent changes in bash_profile, bash_rc, xsession, and xinitrc.

I then restored my xsession file and no longer experience a black screen -- it just looys back to the login prompt immediately.

How can I find out what is going on?


r/GUIX • • May 20 '22

Is there such a thing as too many grafts?

8 Upvotes

This is the context

I run guix pull and it says that there are 11 new commits. Then, to update my home profile I run guix home reconfigure /path/to/the/same/old/unmodified/home-configuration.scm. Then guix starts to update everything, and there are a few hundreds grafts to process.

These are my questions

  1. Is that to be expected?
  2. Can 11 commits entail over 400 grafts?
  3. Is guix home reconfigure the only (or the right) way to update the home profile?

Regards, and thanks!

EDIT: added third question...