Try to add emojify as an optional feature
This commit is contained in:
parent
906fe2fb8d
commit
7368622086
|
@ -21,7 +21,8 @@
|
|||
# A list of default FG42 modules to build FG42 with.
|
||||
{ lib, config, pkgs, makeFG42Drv, ... }:
|
||||
let
|
||||
deps = (with pkgs.emacsPackages; [
|
||||
deps =
|
||||
(with pkgs.emacsPackages; [
|
||||
origami
|
||||
which-key
|
||||
projectile
|
||||
|
@ -42,8 +43,15 @@ let
|
|||
orderless
|
||||
ctrlf
|
||||
marginalia
|
||||
magit
|
||||
forge
|
||||
diff-hl
|
||||
svg-tag-mode
|
||||
all-the-icons
|
||||
|
||||
base16-theme
|
||||
]);
|
||||
] ++ lib.optional (config.fg42.emojify) [ emojify ]);
|
||||
|
||||
drv = makeFG42Drv {
|
||||
pname = "editor";
|
||||
version = config.fg42.version;
|
||||
|
@ -54,6 +62,16 @@ let
|
|||
dicts = pkgs.aspellWithDicts (dicts: with dicts; [ en en-computers en-science ]);
|
||||
in
|
||||
{
|
||||
|
||||
options = (with lib; {
|
||||
fg42.emojify = mkOption {
|
||||
type = types.bool;
|
||||
default = true;
|
||||
description = "Whether or not to use the `emojify' package.";
|
||||
};
|
||||
});
|
||||
|
||||
config = {
|
||||
fg42.elispPackages = [ drv ] ++ deps;
|
||||
|
||||
fg42.fonts = (with pkgs;[
|
||||
|
@ -71,4 +89,5 @@ in
|
|||
fg42.font = lib.mkDefault '''("Fira Mono" 11)'';
|
||||
fg42.theme = lib.mkDefault "base16-eighties";
|
||||
fg42.theme-package-name = lib.mkDefault "base16-theme";
|
||||
};
|
||||
}
|
||||
|
|
|
@ -36,5 +36,13 @@
|
|||
`,sym
|
||||
`,default)))
|
||||
|
||||
|
||||
(defmacro with-config (name &rest body)
|
||||
"Run the BODY only if the config NAME is set to t."
|
||||
(declare (indent defun))
|
||||
`(when (fg42/config-get-or ,name)
|
||||
,@body))
|
||||
|
||||
|
||||
(provide 'fg42/config)
|
||||
;;; config.el ends here
|
||||
|
|
|
@ -37,11 +37,11 @@
|
|||
;; (require 'fg42/langs/elisp)
|
||||
;; (require 'fg42/langs/nix)
|
||||
|
||||
;; (require 'fg42/git)
|
||||
(require 'fg42/git)
|
||||
;; (require 'fg42/wm)
|
||||
;; (require 'fg42/org)
|
||||
(require 'fg42/org)
|
||||
(require 'fg42/minibuffer)
|
||||
;; (require 'fg42/graphics)
|
||||
(require 'fg42/graphics)
|
||||
;; (require 'fg42/modeline)
|
||||
)
|
||||
|
||||
|
|
|
@ -22,9 +22,11 @@
|
|||
;;; Commentary:
|
||||
;;; Code:
|
||||
(eval-when-compile
|
||||
(require 'fpkg))
|
||||
(require 'fpkg)
|
||||
(require 'fg42/config))
|
||||
|
||||
(use! emojify
|
||||
|
||||
(use-with-config! emojify
|
||||
"Adds support for emojis to `FG42'"
|
||||
:if (display-graphic-p)
|
||||
:hook (emacs-startup . global-emojify-mode))
|
||||
|
@ -34,11 +36,6 @@
|
|||
Emacs."
|
||||
:if (display-graphic-p))
|
||||
|
||||
(use! nerd-icons
|
||||
"A utility package to collect various Icon Fonts and propertize them within
|
||||
Emacs."
|
||||
:if (display-graphic-p))
|
||||
|
||||
|
||||
(use! svg-tag-mode
|
||||
"A minor mode to replace keywords or regular expression with SVG tags."
|
|
@ -25,6 +25,8 @@
|
|||
;;
|
||||
;;; Code:
|
||||
(require 'map)
|
||||
(eval-when-compile
|
||||
(require 'fg42-config))
|
||||
|
||||
(defvar package-names ())
|
||||
|
||||
|
@ -63,5 +65,14 @@ DOCS is the documentation of the package."
|
|||
`(use-package ,pkg ,@details))))
|
||||
|
||||
|
||||
(defmacro use-with-config! (name docs &rest details)
|
||||
"A wrapper around `use!' that only activates if a config NAME is set.
|
||||
It passes NAME, DOCS, and DETAILS to `use!' only if a config with the
|
||||
same NAME is set to t."
|
||||
(declare (indent defun) (doc-string 2))
|
||||
`(with-config ,name
|
||||
(use! ,name ,docs ,@details)))
|
||||
|
||||
|
||||
(provide 'fpkg)
|
||||
;;; fpkg.el ends here
|
||||
|
|
Loading…
Reference in New Issue