* Remove Package from Gnome Meta-Package
@ 2024-06-01 20:48 Lee Thompson
2024-06-03 3:30 ` 宋文武
0 siblings, 1 reply; 3+ messages in thread
From: Lee Thompson @ 2024-06-01 20:48 UTC (permalink / raw)
To: help-guix
Hi All,
Is there an analogue in Guix for NixOS's `excludePackage`? Under NixOS I
had something like the following in my system config:
> environment.gnome.excludePackages = with pkgs.gnome; [
> cheese
> epiphany
> gnome-music
> ];
Which allowed me to use a mostly OOTB Gnome install minus some packages
I really don't care about. I've seen some old 2018–2019 posts describing
ways in Guix to make a custom Gnome package minus the bits I don't want,
but I've had no luck so far with this.
I was really hoping there'd be a canonical, obvious and modern way of
achieving this, and if there is in the manual I've had no luck finding
it. Obviously this isn't a deal-breaker for me using Guix, but I think
it would be neat to have.
Any assistance appreciated.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Remove Package from Gnome Meta-Package
2024-06-01 20:48 Remove Package from Gnome Meta-Package Lee Thompson
@ 2024-06-03 3:30 ` 宋文武
2024-06-03 20:52 ` Lee Thompson
0 siblings, 1 reply; 3+ messages in thread
From: 宋文武 @ 2024-06-03 3:30 UTC (permalink / raw)
To: Lee Thompson; +Cc: help-guix
Lee Thompson <lee.p.thomp@gmail.com> writes:
> Hi All,
>
> Is there an analogue in Guix for NixOS's `excludePackage`? Under NixOS I
> had something like the following in my system config:
>> environment.gnome.excludePackages = with pkgs.gnome; [
>> cheese
>> epiphany
>> gnome-music
>> ];
I think it can be done with:
```
(define (exclude-some-packages lst)
(filter (lambda (pkg)
(not (memq pkg (list
gnome-terminal
gnome-user-docs
gnome-maps))))
lst))
(service gnome-desktop-service-type
(let ((cfg (gnome-desktop-configuration)))
(gnome-desktop-configuration
(core-services
(exclude-some-packages (gnome-desktop-configuration-core-services cfg)))
(shell
(exclude-some-packages (gnome-desktop-configuration-shell cfg)))
(utilities
(exclude-some-packages (gnome-desktop-configuration-utilities cfg)))
(extra-packages
(exclude-some-packages (gnome-desktop-configuration-utilities cfg))))))
```
From the its code, we can see that gnome-desktop-configuration use 4
lists for meta packages, which can be customized.
Hope it helps.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Remove Package from Gnome Meta-Package
2024-06-03 3:30 ` 宋文武
@ 2024-06-03 20:52 ` Lee Thompson
0 siblings, 0 replies; 3+ messages in thread
From: Lee Thompson @ 2024-06-03 20:52 UTC (permalink / raw)
To: 宋文武; +Cc: help-guix
宋文武 <iyzsong@envs.net> writes:
> ```
> (define (exclude-some-packages lst)
> (filter (lambda (pkg)
> (not (memq pkg (list
> gnome-terminal
> gnome-user-docs
> gnome-maps))))
> lst))
>
>
> (service gnome-desktop-service-type
> (let ((cfg (gnome-desktop-configuration)))
> (gnome-desktop-configuration
> (core-services
> (exclude-some-packages (gnome-desktop-configuration-core-services cfg)))
> (shell
> (exclude-some-packages (gnome-desktop-configuration-shell cfg)))
> (utilities
> (exclude-some-packages (gnome-desktop-configuration-utilities cfg)))
> (extra-packages
> (exclude-some-packages (gnome-desktop-configuration-utilities cfg))))))
> ```
Thank you this has been very helpful, in the end I adapted your code
like so:
```scheme
(define (gnome-exclude-packages cfg . exclude)
(let ((exclude-packages (λ (pkgs)
(remove (λ (pkg)
(memq pkg exclude))
pkgs))))
(gnome-desktop-configuration
(core-services
(exclude-packages (gnome-desktop-configuration-core-services cfg)))
(shell
(exclude-packages (gnome-desktop-configuration-shell cfg)))
(utilities
(exclude-packages (gnome-desktop-configuration-utilities cfg)))
(extra-packages
(exclude-packages (gnome-desktop-configuration-extra-packages cfg))))))
; ...
(service gnome-desktop-service-type
(gnome-exclude-packages
(gnome-desktop-configuration)
gnome-music epiphany cheese))
```
I wonder if this is the best or most elegant way of achieving this. I'm
interested to see what others think.
> Hope it helps.
Very much, it was a good opportunity to play around in the REPL and see
the data structures for myself which I must admit I was apprehensive
about. Many thanks.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-06-09 9:56 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-01 20:48 Remove Package from Gnome Meta-Package Lee Thompson
2024-06-03 3:30 ` 宋文武
2024-06-03 20:52 ` Lee Thompson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).