services: pulseaudio: Deploy the configuration files to /etc/pulse.
* gnu/services/sound.scm (pulseaudio-environment) [PULSE_CONFIG, PULSE_CLIENTCONFIG]: Use fixed locations, and move logic to... (pulseaudio-etc): ... this service extension. Guard against producing empty files.
This commit is contained in:
parent
60cb647a28
commit
e680c40861
@ -144,11 +144,11 @@ ctl.!default {
|
|||||||
(define pulseaudio-environment
|
(define pulseaudio-environment
|
||||||
(match-lambda
|
(match-lambda
|
||||||
(($ <pulseaudio-configuration> client-conf daemon-conf default-script-file)
|
(($ <pulseaudio-configuration> client-conf daemon-conf default-script-file)
|
||||||
`(("PULSE_CONFIG" . ,(apply mixed-text-file "daemon.conf"
|
;; These config files kept at a fixed location, so that the following
|
||||||
"default-script-file = " default-script-file "\n"
|
;; environment values are stable and do not require the user to reboot to
|
||||||
(map pulseaudio-conf-entry daemon-conf)))
|
;; effect their PulseAudio configuration changes.
|
||||||
("PULSE_CLIENTCONFIG" . ,(apply mixed-text-file "client.conf"
|
'(("PULSE_CONFIG" . "/etc/pulse/daemon.conf")
|
||||||
(map pulseaudio-conf-entry client-conf)))))))
|
("PULSE_CLIENTCONFIG" . "/etc/pulse/client.conf")))))
|
||||||
|
|
||||||
(define (extra-script-files->file-union extra-script-files)
|
(define (extra-script-files->file-union extra-script-files)
|
||||||
"Return a G-exp obtained by processing EXTRA-SCRIPT-FILES with FILE-UNION."
|
"Return a G-exp obtained by processing EXTRA-SCRIPT-FILES with FILE-UNION."
|
||||||
@ -190,8 +190,8 @@ computed-file object~%") file))))
|
|||||||
|
|
||||||
(define pulseaudio-etc
|
(define pulseaudio-etc
|
||||||
(match-lambda
|
(match-lambda
|
||||||
(($ <pulseaudio-configuration> _ _ default-script-file extra-script-files
|
(($ <pulseaudio-configuration> client-conf daemon-conf default-script-file
|
||||||
system-script-file)
|
extra-script-files system-script-file)
|
||||||
`(("pulse"
|
`(("pulse"
|
||||||
,(file-union
|
,(file-union
|
||||||
"pulse"
|
"pulse"
|
||||||
@ -203,7 +203,18 @@ computed-file object~%") file))))
|
|||||||
,@(if (null? extra-script-files)
|
,@(if (null? extra-script-files)
|
||||||
'()
|
'()
|
||||||
`(("default.pa.d" ,(extra-script-files->file-union
|
`(("default.pa.d" ,(extra-script-files->file-union
|
||||||
extra-script-files)))))))))))
|
extra-script-files))))
|
||||||
|
,@(if (null? daemon-conf)
|
||||||
|
'()
|
||||||
|
`(("daemon.conf"
|
||||||
|
,(apply mixed-text-file "daemon.conf"
|
||||||
|
"default-script-file = " default-script-file "\n"
|
||||||
|
(map pulseaudio-conf-entry daemon-conf)))))
|
||||||
|
,@(if (null? client-conf)
|
||||||
|
'()
|
||||||
|
`(("client.conf"
|
||||||
|
,(apply mixed-text-file "client.conf"
|
||||||
|
(map pulseaudio-conf-entry client-conf))))))))))))
|
||||||
|
|
||||||
(define pulseaudio-service-type
|
(define pulseaudio-service-type
|
||||||
(service-type
|
(service-type
|
||||||
|
Loading…
Reference in New Issue
Block a user