Created
December 29, 2018 15:33
-
-
Save Jomik/e1970ff84fead64743477a4c72eeb1f9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ 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