help-guix
[Top][All Lists]
Advanced

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

Re: redshift


From: Sergiu Ivanov
Subject: Re: redshift
Date: Sun, 12 Mar 2023 12:07:41 +0100
User-agent: mu4e 1.8.13; emacs 28.2

Hi Gottfried,

Gottfried <gottfried@posteo.de> [2023-03-11T17:47:19+0100]:
> I got a message from Julen Lepiller that reshift is a guix-home-service-type
> so I can’t use it in guix system.
>
> Have you got guix home and redshift there in your config.scm?
>
> I don’t have guix home,
> so can I use redshift?

guix home is a tool for managing your home configuration (the list of
user packages and parts of their configuration) in the same way as you
manage your system configuration [0].  In particular, this is how
I update my user packages with guix home:

guix home reconfigure ~/.config/guix/home.scm

You don't have to use it, but some people (e.g., me) like this approach.

To add Redshift to my home services, I add the following lines to
home.scm [1]:

(define redshift-service
  (service home-redshift-service-type
           (home-redshift-configuration
            (location-provider 'manual)
            (latitude 111)
            (longitude 222))))

where I replace 111 by the latitude of my location and 222 by the
longitude of my location.  This code defines the Redshift service and
binds it to the name `redshift-service`.  I then add this service to my
home services using the following code:

(home-environment
  (services (list redshift-service ...)) ...)

I also have other services and I define other parameters for
`home-environment`, which is why I put `...` in this example.  `...` is
not intended to be valid Guile in this context.

After guix home reconfigure ~/.config/guix/home.scm, I can see which
home services are running using the commmand

herd status

which shows something like:

Started:
 + redshift
 + root

and some other services.  Mind that I run herd status as my normal user,
without sudo.  Running sudo herd status will show you a much longer list
of system services.

To see the status of my home service redshift, I run

herd status redshift

which shows something like:

Status of redshift:
  It is started.
  Running value is 996.
  It is enabled.
  Provides (redshift).
  Requires ().
  Conflicts with ().
  Will be respawned.

You will note that Arne's manual approach is simpler to understand, so
you will probably want to go with it for now.  I am posting my
configuration just in case you are curious, and also for some other
people who may be looking for something similar.

-
Sergiu

[0] https://guix.gnu.org/manual/devel/en/html_node/Home-Configuration.html
[1] https://guix.gnu.org/manual/devel/en/html_node/Desktop-Home-Services.html



reply via email to

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