[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Replacing a package system-wide

From: Ludovic Courtès
Subject: Re: Replacing a package system-wide
Date: Tue, 15 Mar 2022 10:00:46 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)


Dominic Martinez <> skribis:

> One of the things I love about Guix is how easy it is to modify 
> dependencies, a feature I use fairly often on individual packages 
> or manifests. However, I'm struggling to get a similar effect 
> system-wide.
> Grafts do exactly what I want, but since they are defined in the 
> upstream package definition I can't set them for my personal 
> system. Package rewriting lets me do this on a plain list of 
> packages, but it's really difficult to do the same for services 
> and not possible for guix shell/other command line usage.
> #+begin_src scheme
> (operating-system
>  ;; Package rewriting makes this fairly straight-forward
>  (packages (fix-pkg %my-packages))
>  ;; But for packages deep in the dependency tree, you have to
>  ;; track down every service that has this package as a transient
>  ;; dependency and fix it.
>  (services
>   (service some-pkg-service-type
>            (some-pkg-service-configuration
>             (some-pkg-service (fix-pkg pkg))))
>   ;; Repeat ad-nauseum
>   ))
> #+end_src

This is correct: there’s currently no general package-rewriting
mechanism for ‘operating-system’ as a whole.  As a result, you have to
customize individual services like you show above.

I agree it would be nice to offer a programatic way to replace packages,
though I’m not sure what it should look like.

Right now it’s tricky to peek at all the packages that services refer
to, because in the end, these references are embedded in gexps that are
“lowered” to files such as Shepherd service definitions.  We would need
a hook (at the gexp level? at a higher level?) to interpose on all
package references that get lowered.

Food for thought…


reply via email to

[Prev in Thread] Current Thread [Next in Thread]