mirror of
https://github.com/nix-community/home-manager
synced 2024-11-14 23:29:46 +01:00
27 lines
602 B
Nix
27 lines
602 B
Nix
|
{ 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
|
||
|
'';
|
||
|
}
|