Thank you Ian,
I'm slowly making my Guix configuration more composable, and your
examples are really useful. I'd like to get to the point where I can
always see the both the opening and closing brace on one screen.
I always run into seemingly trivial problems. E.g. copy pasting your
`xf-remove-gdm` definition into my config.scm, at the top level, before
my operating system definition, but not actually using it, leads to:
config.scm:77:5: error: (operating-system (services (modify-services
(operating-system-user-services os) (delete gdm-service-type)))):
missing field initializers (bootloader host-name file-systems)
I added a `(inherit os)` in there, that seems to do it.
It's like typing this message made me figure out what to do; but now I
did, I might as well share it.
And apparently `print-issue` is without a question mark. Amazing how
everything is configurable though! I would probably not have thought
about adding this boolean, kudos to Tomas Volf.
(Next Guix days, we should all type out a system configuration from
scratch, without peeking, and see how well we do.)
Hugo
$ guix describe
guix 5aef3b0
repository URL: https://git.guix.gnu.org/guix.git
branch: master
commit: 5aef3b016bd899e69a40efcf35588ac3dca47cc0
On 3/21/26 23:01, Ian Eure wrote:
Hi Kieran,
Kieran Brandle <[email protected]> writes:
Heya!
I was wondering if I could please have some help with the config file?
Ive
really wanted to do:
Turn “issue” off
Use TTY to then run openbox on login (no login manager)
However ive had no success trying to implement both, and GDM seems to
be a
bit of a blockade as well, please may i ask for an example of how they
can
be implemented?
Both these require modifying your operating-system services.
Printing /etc/issue is controlled by the `print-issue?' field of
`mingetty-configuration', used by `mingetty-service-type'.
To remove gdm, you need to delete `gdm-service-type' from your service
list.
Both these can be done with modify-services:
(operating-system
(services
(modify-services %desktop-services
(delete gdm-service-type)
(mingetty-service-type config =>
(mingetty-configuration
(inherit config)
(print-issue? #f))))))
While you can edit your operating-system definition directly, I like to
put this kind of thing into a transformation function, which takes an
operating-system record and returns a changed one. Building
transformations like this allows me to keep configuration centralized,
and easily combine different transformations to produce the final
configuration. As an example:
(define (xf-remove-gdm os)
(operating-system
(services
(modify-services (operating-system-user-services os)
(delete gdm-service-type)))))
(define (xf-suppress-/etc/issue os)
(operating-system
(services
(modify-services (operating-system-user-services os)
(mingetty-service-type config =>
(mingetty-configuration
(inherit config)
(print-issue? #f)))))))
(define xfs (compose xf-remove-gdm xf-suppress-/etc/issue))
The `xfs' at the end is a procedure (that is, a function) which applies
both transformations. You can either put it around your existing
configuration:
(xfs
(operating-system
...
))
...or assign your configuration to a variable, then transform it on the
last line of your config:
(define %os
(operating-system
...
))
(xfs %os)
-- Ian