[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug#62298] [PATCH v2 7/8] services: mpd: Use user-account (resp. user-g
From: |
Liliana Marie Prikler |
Subject: |
[bug#62298] [PATCH v2 7/8] services: mpd: Use user-account (resp. user-group) for user (resp. group) fields. |
Date: |
Thu, 23 Mar 2023 19:03:45 +0100 |
User-agent: |
Evolution 3.46.0 |
Am Donnerstag, dem 23.03.2023 um 15:02 +0000 schrieb Bruno Victal:
> If a string value is encountered, it is ignored and a predefined
> variable is used instead. This is essentially a rollback to how it
> used to be before '5c5f0fc1135ff15f9c4adfc5f27eadd9a592b5d1'.
As far as I can see, this is not actually what happens. Don't forget
to update your commit messages :)
> Fixes #61570 <https://issues.guix.gnu.org/61570>.
You only need one newline after this one imho.
> --- a/gnu/services/audio.scm
> +++ b/gnu/services/audio.scm
> @@ -140,6 +140,14 @@ (define (uglify-field-name field-name)
> (define list-of-symbol?
> (list-of symbol?))
>
> +;; helpers for deprecated field types, to be removed later
> +(define %lazy-group (make-symbol "%lazy-group"))
> +
> +(define (inject-group-into-user user group)
> + (user-account
> + (inherit user)
> + (group (user-group-name group))))
> +
>
> ;;;
> ;;; MPD
> @@ -559,17 +620,11 @@ (define (mpd-shepherd-service config)
>
> (define (mpd-accounts config)
> (match-record config <mpd-configuration> (user group)
> - (list (user-group
> - (name group)
> - (system? #t))
> - (user-account
> - (name user)
> - (group group)
> - (system? #t)
> - (comment "Music Player Daemon (MPD) user")
> - ;; MPD can use $HOME (or $XDG_CONFIG_HOME) to place its
> data
> - (home-directory "/var/lib/mpd")
> - (shell (file-append shadow "/sbin/nologin"))))))
> + ;; TODO: deprecation code, to be removed
> + (let ((user (if (eq? (user-account-group user) %lazy-group)
> + (inject-group-into-user user group)
> + user)))
> + (list user group))))
A little over-engineered, but works for me :)
Cheers
- [bug#62298] [PATCH v2 6/8] services: mpd: Set PulseAudio related variables as default value for environment-variables field., (continued)
- [bug#62298] [PATCH v2 6/8] services: mpd: Set PulseAudio related variables as default value for environment-variables field., Bruno Victal, 2023/03/23
- [bug#62298] [PATCH v2 3/8] services: audio: remove redundant list-of-string? predicate., Bruno Victal, 2023/03/23
- [bug#62298] [PATCH v2 8/8] services: mympd: Use user-account (resp. user-group) for user (resp. group) fields., Bruno Victal, 2023/03/23
- [bug#62298] [PATCH v2 8/8] services: mympd: Use user-account (resp. user-group) for user (resp. group) fields., Maxim Cournoyer, 2023/03/24
- [bug#62298] [PATCH v2 8/8] services: mympd: Use user-account (resp. user-group) for user (resp. group) fields., Bruno Victal, 2023/03/24
- [bug#62298] [PATCH v2 8/8] services: mympd: Use user-account (resp. user-group) for user (resp. group) fields., Liliana Marie Prikler, 2023/03/25
[bug#62298] [PATCH v2 7/8] services: mpd: Use user-account (resp. user-group) for user (resp. group) fields., Bruno Victal, 2023/03/23
[bug#62298] [PATCH v2 5/8] services: mpd: Fix unintentional API breakage for mixer-type field., Bruno Victal, 2023/03/23
[bug#62298] [PATCH v2 1/8] services: configuration: Add user-defined sanitizer support., Liliana Marie Prikler, 2023/03/23
[bug#62298] [PATCH v2 1/8] services: configuration: Add user-defined sanitizer support., Maxim Cournoyer, 2023/03/24
[bug#62298] [PATCH v3 1/5] services: configuration: Add user-defined sanitizer support., Bruno Victal, 2023/03/24