diff options
author | Thomas Voss <mail@thomasvoss.com> | 2024-09-09 22:36:51 +0200 |
---|---|---|
committer | Thomas Voss <mail@thomasvoss.com> | 2024-09-09 22:36:51 +0200 |
commit | 1065d29d7dbdd35f5cd539a975e847d537322178 (patch) | |
tree | 12a5c59fb9988d1754ddd90233dfdb486adc280c /.config | |
parent | e3236fe7cdbb6bc35f3d567345ca4c5421c1c491 (diff) |
emacs: Use https if gnutls is available
Diffstat (limited to '.config')
-rw-r--r-- | .config/emacs/init.el | 13 |
1 files 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) |