From 1065d29d7dbdd35f5cd539a975e847d537322178 Mon Sep 17 00:00:00 2001 From: Thomas Voss Date: Mon, 9 Sep 2024 22:36:51 +0200 Subject: emacs: Use https if gnutls is available --- .config/emacs/init.el | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/.config/emacs/init.el b/.config/emacs/init.el index 55b46dd..a29893f 100644 --- a/.config/emacs/init.el +++ b/.config/emacs/init.el @@ -15,11 +15,14 @@ native-comp-jit-compilation t)) (require 'package) -(custom-set-variables - '(package-archives '(("gnu" . "http://elpa.gnu.org/packages/") - ("nongnu" . "https://elpa.nongnu.org/nongnu/") - ("melpa" . "http://melpa.org/packages/"))) - '(package-user-dir (expand-file-name "pkg" x-data-directory))) +(let ((scheme (concat "http" (when (gnutls-available-p) "s") "://"))) + (customize-set-variable + 'package-archives + `(("gnu" . ,(concat scheme "elpa.gnu.org/packages/")) + ("nongnu" . ,(concat scheme "elpa.nongnu.org/nongnu/")) + ("melpa" . ,(concat scheme "melpa.org/packages/"))))) +(customize-set-variable + 'package-user-dir (expand-file-name "pkg" x-data-directory)) (package-initialize) (unless (package-installed-p 'use-package) -- cgit v1.2.3