guix-devel
[Top][All Lists]
Advanced

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

Re: [PATCHES] Add elogind service


From: Ludovic Courtès
Subject: Re: [PATCHES] Add elogind service
Date: Wed, 02 Sep 2015 21:10:19 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux)

Andy Wingo <address@hidden> skribis:

> From fdd8893f287696fb016e9e78fbcba04d03840ee6 Mon Sep 17 00:00:00 2001
> From: Andy Wingo <address@hidden>
> Date: Tue, 18 Aug 2015 10:05:24 +0200
> Subject: [PATCH 1/7] gnu: elogind: Update to version 219.12.
>
> * gnu/packages/freedesktop.scm (elogind): Update to 219.12.  Use a tarball
>   instead of a git checkout.

OK!  Thanks for making the tarball.

> From 4f32d646cf14133a98899c448d588088c80d680d Mon Sep 17 00:00:00 2001
> From: Andy Wingo <address@hidden>
> Date: Tue, 18 Aug 2015 11:56:17 +0200
> Subject: [PATCH 2/7] gnu: Add elogind service.
>
> * gnu/services/desktop.scm (elogind-configuration-file, elogind-service): New
>   functions.
>   (%desktop-services): Add elogind-service.

[...]

> +(define-with-required-kwargs elogind-configuration-file
> +  (kill-user-processes? kill-only-users kill-exclude-users
> +   inhibit-delay-max-seconds
> +   handle-power-key handle-suspend-key handle-hibernate-key
> +   handle-lid-switch handle-lid-switch-docked
> +   power-key-ignore-inhibited? suspend-key-ignore-inhibited?
> +   hibernate-key-ignore-inhibited? lid-switch-ignore-inhibited?
> +   holdoff-timeout-seconds
> +   idle-action idle-action-seconds
> +   runtime-directory-size-percent runtime-directory-size
> +   remove-ipc?
> +   suspend-state suspend-mode
> +   hibernate-state hibernate-mode
> +   hybrid-sleep-state hybrid-sleep-mode)

[...]

> +(define* (elogind-service #:key (elogind elogind)
> +                          (kill-user-processes? #f)
> +                          (kill-only-users '()) (kill-exclude-users 
> '("root"))
> +                          (inhibit-delay-max-seconds 5)
> +                          (handle-power-key 'poweroff)
> +                          (handle-suspend-key 'suspend)
> +                          (handle-hibernate-key 'hibernate)
> +                          (handle-lid-switch 'suspend)
> +                          (handle-lid-switch-docked 'ignore)
> +                          (power-key-ignore-inhibited? #f)
> +                          (suspend-key-ignore-inhibited? #f)

Nice.

My inclination would be to either let people provide the raw
configuration file via ‘local-file’ or ‘plain-file’ (and provide a
default one), but obviously that’s not as nice, or to use
‘define-record-type*’ to create an <elogind-configuration> record with
sensible default values (similar to <nscd-configuration>, for instance.)
I have a preference for the latter.

WDYT?

(It’s OK to add a macro to generate the record’s getter identifiers
since there are so many of them.)

Thank you!

Ludo’.



reply via email to

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