diff --git a/snamellit/common.scm b/snamellit/common.scm index c5403c0..baf819a 100644 --- a/snamellit/common.scm +++ b/snamellit/common.scm @@ -278,6 +278,21 @@ (service home-mcron-service-type) )) +;; add folders at the end of a PATH like string, removing duplicates but +;; keeping the order of first occurrence +(define + (add-folders-to-path path folders) + (if + (null? folders) + (string-join + (delete-duplicates + (string-split path #\:)) + ":") + (add-folders-to-path + (string-append path ":" + (car folders)) + (cdr folders)))) + (define-public %snam-desktop-services (list (service home-dbus-service-type)