configs/emacs: allow disabling of emacs install
This commit is contained in:
parent
87b8e0d9ad
commit
71e3925991
@ -1,10 +1,12 @@
|
||||
{ pkgs
|
||||
, isUnstable
|
||||
, lib
|
||||
, config
|
||||
, ...
|
||||
}:
|
||||
let
|
||||
myEmacs = pkgs.callPackage ../pkgs/emacs.nix { inherit isUnstable; };
|
||||
cfg = config.myEmacs;
|
||||
editorScript = pkgs.writeShellScriptBin "emacseditor" ''
|
||||
if [ -z "$1" ]; then
|
||||
exec ${myEmacs}/bin/emacsclient --create-frame --alternate-editor ${myEmacs}/bin/emacs
|
||||
@ -14,7 +16,13 @@ let
|
||||
'';
|
||||
in
|
||||
{
|
||||
config = {
|
||||
options = {
|
||||
myEmacs = {
|
||||
enable = lib.mkEnableOption "Enable my emacs stuff";
|
||||
default = true;
|
||||
};
|
||||
};
|
||||
config = lib.mkIf cfg.enable {
|
||||
environment = {
|
||||
variables.EDITOR = lib.mkOverride 900 "emacseditor";
|
||||
systemPackages = with pkgs; [
|
||||
|
Loading…
Reference in New Issue
Block a user