anchor.diff:        '';
       };
   
  +    defaultEditor = mkOption {
  +      type = types.bool;
  +      default = false;
  +      example = true;
  +      description = ''
  +        When enabled, configures emacsclient to be the default editor
  +        using the EDITOR environment variable.
  +      '';
  +    };
     };
   
     config = mkIf (cfg.enable || cfg.install) {
  
positive.code: let
  
    cfg = config.services.emacs;
  
  in {
  
  
negative.code:       };
      } // optionalAttrs cfg.enable { wantedBy = [ "default.target" ]; };
  
      environment.systemPackages = [ cfg.package editorScript ];
  
      environment.variables = if cfg.defaultEditor then {
        EDITOR = mkOverride 900 "${editorScript}/bin/emacseditor";
      } else {};
    };
  }
  