Skip to content

Instantly share code, notes, and snippets.

@Jomik
Created December 29, 2018 15:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Jomik/e1970ff84fead64743477a4c72eeb1f9 to your computer and use it in GitHub Desktop.
Save Jomik/e1970ff84fead64743477a4c72eeb1f9 to your computer and use it in GitHub Desktop.
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.programs.emacs;
themeNames = map (removeSuffix "-theme") (filter (hasSuffix "-theme") (attrNames pkgs.emacsPackagesNg));
in {
options.programs.emacs.theme = mkOption {
type = types.enum themeNames;
default = null;
description = "";
};
config.programs.emacs = mkIf (cfg.theme != null) {
extraPackages = epkgs: [
epkgs."${cfg.theme}-theme"
];
init = {
theme = "(load-theme '${cfg.theme} t)";
};
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment