From 66c2d6470e4cbd709d00e5f33614274f4cf22ab2 Mon Sep 17 00:00:00 2001 From: Noah Metz Date: Tue, 5 Dec 2023 23:13:42 -0700 Subject: [PATCH] Conditionally create sssd.conf --- metznet/services/sssd.scm | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/metznet/services/sssd.scm b/metznet/services/sssd.scm index 596da1c..7098a09 100644 --- a/metznet/services/sssd.scm +++ b/metznet/services/sssd.scm @@ -70,8 +70,7 @@ (define-configuration sssd-configuration (sssd (file-like sssd) "sssd package to use") - (pam-services (list-of-strings (list "su" "sddm" "login" "sshd" - "passwd")) + (pam-services (list-of-strings (list "su" "sddm" "login" "sshd" "passwd")) "list of pam services to configure login for" (lambda (a b) "")) @@ -139,8 +138,11 @@ (user (getpw "root"))) (mkdir-p/perms dbusdir user 493) (mkdir-p/perms dbdir user 493) - (copy-file #$(sssd-configuration-file config) "/var/lib/sss/sssd.conf") - (chmod "/var/lib/sss/sssd.conf" #o600)))) + (unless (file-exists? "/var/lib/sss/sssd.conf") + (begin + (copy-file #$(sssd-configuration-file config) + "/var/lib/sss/sssd.conf") + (chmod "/var/lib/sss/sssd.conf" #o600)))))) (define-public sssd-service-type (service-type (name 'sssd)