emacs: add extraConfig option
This commit is contained in:
parent
29ea37374d
commit
b0d769691c
5 changed files with 59 additions and 3 deletions
1
tests/modules/programs/emacs/default.nix
Normal file
1
tests/modules/programs/emacs/default.nix
Normal file
|
|
@ -0,0 +1 @@
|
|||
{ emacs-extra-config = ./extra-config.nix; }
|
||||
26
tests/modules/programs/emacs/extra-config.nix
Normal file
26
tests/modules/programs/emacs/extra-config.nix
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
let
|
||||
|
||||
testScript = pkgs.writeText "test.el" ''
|
||||
;; Emacs won't automatically load default.el when --script is specified
|
||||
(load "default")
|
||||
(kill-emacs (if (eq hm 'home-manager) 0 1))
|
||||
'';
|
||||
|
||||
emacsBin = "${config.programs.emacs.finalPackage}/bin/emacs";
|
||||
|
||||
in {
|
||||
programs.emacs = {
|
||||
enable = true;
|
||||
package = pkgs.emacs-nox;
|
||||
extraConfig = "(setq hm 'home-manager)";
|
||||
};
|
||||
|
||||
# running emacs with --script would enable headless mode
|
||||
nmt.script = ''
|
||||
if ! ${emacsBin} --script ${testScript}; then
|
||||
fail "Failed to load default.el."
|
||||
fi
|
||||
'';
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue