Conditionally create sssd.conf

master
noah metz 2023-12-05 23:13:42 -07:00
parent 4405a390cc
commit 66c2d6470e
1 changed files with 6 additions and 4 deletions

@ -70,8 +70,7 @@
(define-configuration sssd-configuration (define-configuration sssd-configuration
(sssd (file-like sssd) "sssd package to use") (sssd (file-like sssd) "sssd package to use")
(pam-services (list-of-strings (list "su" "sddm" "login" "sshd" (pam-services (list-of-strings (list "su" "sddm" "login" "sshd" "passwd"))
"passwd"))
"list of pam services to configure login for" "list of pam services to configure login for"
(lambda (a b) (lambda (a b)
"")) ""))
@ -139,8 +138,11 @@
(user (getpw "root"))) (user (getpw "root")))
(mkdir-p/perms dbusdir user 493) (mkdir-p/perms dbusdir user 493)
(mkdir-p/perms dbdir user 493) (mkdir-p/perms dbdir user 493)
(copy-file #$(sssd-configuration-file config) "/var/lib/sss/sssd.conf") (unless (file-exists? "/var/lib/sss/sssd.conf")
(chmod "/var/lib/sss/sssd.conf" #o600)))) (begin
(copy-file #$(sssd-configuration-file config)
"/var/lib/sss/sssd.conf")
(chmod "/var/lib/sss/sssd.conf" #o600))))))
(define-public sssd-service-type (define-public sssd-service-type
(service-type (name 'sssd) (service-type (name 'sssd)