Fix mode loading

Signed-off-by: Magic_RB <magic_rb@redalder.org>
This commit is contained in:
Magic_RB 2023-09-02 15:17:37 +02:00
parent 8ad68d6c4c
commit 1c13d31cb8
No known key found for this signature in database
GPG key ID: 08D5287CC5DDCA0E

View file

@ -48,12 +48,11 @@
"modus-themes" "modus-themes"
"org-thtml" "org-thtml"
"emacs-htmlize" "emacs-htmlize"
"magit"
"web-mode" "web-mode"
"hcl-mode" "hcl-mode"
"modus-themes"
"yaml-mode" "yaml-mode"
"nix-mode" "nix-mode"
"magit"
"compat" "compat"
"dash" "dash"
"s-el" "s-el"
@ -63,11 +62,18 @@
]; ];
loadPackages = pkgs: loadPackages = pkgs:
pkgs.writeText "packages.el" pkgs.writeText "packages.el"
(concatMapStringsSep "\n" (x: '' ((concatMapStringsSep "\n" (x: ''
(if (file-exists-p "${inputs.${x}}/lisp") (if (file-exists-p "${inputs.${x}}/lisp")
(add-to-list 'load-path "${inputs.${x}}/lisp") (add-to-list 'load-path "${inputs.${x}}/lisp")
(add-to-list 'load-path "${inputs.${x}}")) (add-to-list 'load-path "${inputs.${x}}"))
'') packages); '') packages)
+
"\n"
+
(concatMapStringsSep "\n" (x: ''
(when (string-match-p "^.*-mode$" "${x}")
(require '${x}))
'') packages));
site = pkgs: which: site = pkgs: which:
pkgs.stdenv.mkDerivation { pkgs.stdenv.mkDerivation {
name = which; name = which;
@ -133,11 +139,6 @@
'' ''
(load-file "${loadPackages pkgs}") (load-file "${loadPackages pkgs}")
(require 'nix-mode)
(require 'web-mode)
(require 'hcl-mode)
(require 'yaml-mode)
(require 'org) (require 'org)
(require 'ox) (require 'ox)
(require 'ox-html) (require 'ox-html)