Add emacs font and opacity config to expression

Set stylix opacity for applications and desktop to 0.8 as well

Use stylix font and opacity values for emacs rather than duplicating
This commit is contained in:
Evie Litherland-Smith 2024-02-02 10:47:42 +00:00
parent 4832474060
commit 395c93db09
2 changed files with 13 additions and 1 deletions

View file

@ -147,6 +147,8 @@
};
polarity = "dark";
opacity = {
applications = 0.8;
desktop = 0.8;
popups = 0.5;
terminal = 0.8;
};

View file

@ -7,7 +7,17 @@
# Clone emacs config from https://git.xenia.me.uk/xenia/emacs.git
enable = true;
package = pkgs.emacs29-pgtk;
extraConfig = ''(org-babel-load-file "~/.emacs/README.org")'';
extraConfig = with builtins;
with config; let
font = "${stylix.fonts.monospace.name}-${toString stylix.fonts.sizes.applications}";
alpha = "${toString (floor (mul stylix.opacity.applications 100))}";
in ''
(org-babel-load-file "~/.emacs/README.org")
(add-to-list 'initial-frame-alist '(font . "${font}"))
(add-to-list 'default-frame-alist '(font . "${font}"))
(add-to-list 'initial-frame-alist '(alpha-background . ${alpha}))
(add-to-list 'default-frame-alist '(alpha-background . ${alpha}))
'';
extraPackages = epkgs:
with epkgs; [
# theme