3IF4SVIQTLK6UQOSBQGOMGGBTJKMBWZCHU4CUB7ELVYPMJMRCPYAC DRGXBPT6YOYGMP2KOEMDFHW4OVT4GUXYUUZYIQYJNSUFMNRUL4NQC E2BHKLWGFZ2OEWDL2LKOX3ILDAHOOYECZLNWZPTZ6PNRD7FN2W3AC 4NMWIOGC3TDYLBPDCN4ROBI5RFWBDYSXCXQROXTDBD5KNNUKMBUAC FA3FOJPIQ6SIN7D75UUPQS33YUFY2QII2P2EGGLQE3O34US3RWMQC DLGBTNWXH3OY7GTHOFAVY6TPB47JT46IC5KPCA4LTQZMNWWLQO3AC 7EJ73VKJCRGH5AHRXJQGVZ3YJIMVS5YNXSZESKET57SLTFT6OJKQC 2LYDCK7FELSPFXDZ4OBIKOC3ZJJBHVEVQWFAJQBSSEYODSJKWHCQC ZEQTD7IOVELL5IFZUDSFWNTF5YYOOY65NV4CASSB3IZNWT6BJBEAC EY5PA42EHDJQDDEMZS574UPF4GWAR4JLZ7HAXZGJ5ROO43UMYQ7AC MF7Z6JGGZQPQVEJJQONY73UBNH6UEQM4JHS772GHWHJ75IGMQJ6AC (setq inhibit-startup-message t)(menu-bar-mode -1)(tool-bar-mode -1)(blink-cursor-mode 1);; ---- show the line and column number ----(global-hl-line-mode t)(line-number-mode t)(global-display-line-numbers-mode t)(column-number-mode t)(size-indication-mode t);; ---- backup files and autosave files directory ----(add-to-list 'backup-directory-alist(cons (expand-file-name "~/") (expand-file-name "~/.emacs.d/.backup/")))(add-to-list 'auto-save-file-name-transforms`("~/\\([^/]*/\\)*\\([^/]*\\)$" "~/.emacs.d/.backup/\\2" t))(setopt auto-save-list-file-prefix "~/.emacs.d/.backup/.saves-")(defvar rag-file-name-handler-alist file-name-handler-alist)(setopt file-name-handler-alist nil);; ---- use-package ----(require 'use-package)(setq use-package-always-ensure nil)(use-package vertico:config(vertico-mode 1)(setq vertico-cycle t))(use-package orderless:init(setq completion-styles '(orderless basic)completion-category-defaults nilcompletion-category-overrides '((file (styles partial-completion)))))(use-package marginalia:config(marginalia-mode 1))(use-package consult:bind (("C-s" . consult-line)("C-c h" . consult-history)("C-c m" . consult-mode-command)("C-c k" . consult-ripgrep)("C-x b" . consult-buffer)))(use-package which-key:init(which-key-mode 1))(use-package nix-mode:mode "\\.nix\\'")(let ((hm-bin (expand-file-name "~/.nix-profile/bin")))(when (file-directory-p hm-bin)(add-to-list 'exec-path hm-bin)(setenv "PATH" (concat hm-bin ":" (getenv "PATH")))))(let* ((agda-mode-el(string-trim(let ((coding-system-for-read 'utf-8))(shell-command-to-string "agda --emacs-mode locate")))))(when (file-readable-p agda-mode-el)(load-file agda-mode-el)))(use-package eglot:config(add-to-list 'eglot-server-programs '(agda2-mode . ("als")))(add-to-list 'eglot-server-programs '(agda-mode . ("als")));; Auto-start(add-hook 'haskell-mode-hook 'eglot-ensure)(add-hook 'agda2-mode-hook 'eglot-ensure)(add-hook 'agda-mode-hook 'eglot-ensure)(add-hook 'idris2-mode-hook 'eglot-ensure):custom(eglot-autoshutdown t)(eglot-confirm-server-initiated-edits nil))(setq completion-ignore-case tread-file-name-completion-ignore-case t);; ---- color scheme ----(use-package stimmung-themes:config(let ((dir (file-name-directory (locate-library "stimmung-themes"))))(when dir(add-to-list 'custom-theme-load-path dir)))(stimmung-themes-load-dark))(add-to-list 'eglot-server-programs '(idris2-mode . ("idris2-lsp")));; Agda / Idris2 language servers:commands (eglot eglot-ensure);; ---- Idris2 major mode ----(use-package idris2-mode:mode "\\.idr\\'");; ---- eglot (LSP) ----;; ---- haskell major mode ----(use-package haskell-mode:mode "\\.hs\\'":hook(haskell-mode . eglot-ensure):config(setq haskell-process-args-cabal-new-repl'("--ghc-options=-ferror-spans -fshow-loaded-modules"))(setq haskell-stylish-on-save t)(setq haskell-tags-on-save t))(use-package tidal:config(setq tidal-boot-script-path "~/.config/tidal/BootTidal.hs"));; ---- Agda mode: load the matching elisp from the current `agda` ----;; ---- Ensure Nix profile is visible to GUI Emacs ----(use-package evil-commentary:after evil:config(evil-commentary-mode 1));; ---- completion UI stack ----;; ---- easky ----(use-package easky);; ---- dashboard ----(use-package dashboard:config(dashboard-setup-startup-hook)(setq dashboard-startup-banner 'logo)(setq dashboard-center-content t)(setq dashboard-vertically-center-content t));; ---- evil (vim emulation) ----(use-package evil:init(setq evil-want-integration tevil-want-keybinding nilevil-want-C-u-scroll tevil-want-C-i-jump nil):config(evil-mode 1))(use-package evil-collection:after evil:config(evil-collection-init))(use-package evil-surround:after evil:config(global-evil-surround-mode 1))(toggle-scroll-bar -1);; ==== init.el ====(setq default-tab-width 2)(defvar no-littering-etc-directory (expand-file-name "~/.cache/emacs/etc"))(defvar no-littering-var-directory (expand-file-name "~/.cache/emacs/var"))(when (boundp 'native-comp-eln-load-path)(startup-redirect-eln-cache (expand-file-name "eln-cache" no-littering-var-directory)));; ---- text encoding ----(prefer-coding-system 'utf-8)(set-default-coding-systems 'utf-8)(set-terminal-coding-system 'utf-8)(set-keyboard-coding-system 'utf-8);; ---- default ui components ----
;; -*- mode: eask; lexical-binding: t -*-(package "dotemacs" "0.1.0" "My Emacs configuration")(keywords "config")(files "early-init.el" "init.el""lisp/*.el""site-lisp/*.el")(source "gnu")(source "melpa")(source "jcs-elpa")(depends-on "use-package")(depends-on "easky")(depends-on "vertico")(depends-on "orderless")(depends-on "marginalia")(depends-on "consult")(depends-on "which-key")(depends-on "eglot")(depends-on "nix-mode")(depends-on "haskell-mode")(depends-on "tidal")(depends-on "idris2-mode":fetcher 'github:repo "idris-community/idris2-mode")(depends-on "embark")(depends-on "embark-consult")(depends-on "evil")(depends-on "evil-collection")(depends-on "evil-surround")(depends-on "evil-commentary")(depends-on "dashboard")(depends-on "stimmung-themes")(development(depends-on "ellsp"))
(setq package-enable-at-startup nil)(setq gc-cons-threshold 10000000000)(setq large-file-warning-threshold 1000000000)(setq byte-compile-warnings '(not obsolete))(setq warning-suppress-log-types '((comp) (bytecomp)))(setq native-comp-async-report-warnings-errors 'silent);; (setq inhibit-startup-echo-area-message (user-login-name))(provide 'early-init)
{ config, lib, pkgs, ... }:letcfg = config.programs.emacsEask;emacsDir = cfg.emacsDir;eask = cfg.easkPackage;emacs = cfg.emacsPackage;easkRuntimePath = lib.makeBinPath ([ eask pkgs.git ] ++ cfg.extraRuntimePackages);easkFilePath = "${emacsDir}/Eask";easkConfigArgs = [ "-c" ];emacsWrapper = pkgs.writeShellApplication {name = "emacs";text = ''set -euEMACSDIR=${lib.escapeShellArg emacsDir}if [ -d "$EMACSDIR" ] && [ -f "$EMACSDIR/Eask" ]; thencd "$EMACSDIR"export PATH=${lib.escapeShellArg (lib.makeBinPath [ emacs ])}:"$PATH"export PATH=${lib.escapeShellArg easkRuntimePath}:"$PATH"exec ${lib.escapeShellArg "${emacs}/bin/emacs"} "$@"elseexec ${lib.escapeShellArg "${emacs}/bin/emacs"} "$@"fi'';};in{options.programs.emacsEask = {enable = lib.mkEnableOption "Manage Emacs Lisp deps via Eask from Home Manager.";emacsDir = lib.mkOption {type = lib.types.str;default = "${config.home.homeDirectory}/.emacs.d";};emacsPackage = lib.mkOption {type = lib.types.package;default = pkgs.emacs;};easkPackage = lib.mkOption {type = lib.types.package;default = pkgs.eask-cli;};easkFileSource = lib.mkOption {type = lib.types.path;};installDevDeps = lib.mkOption {type = lib.types.bool;default = true;};installDepsArgs = lib.mkOption {type = lib.types.listOf lib.types.str;default = [ "--dev" ];};extraRuntimePackages = lib.mkOption {type = lib.types.listOf lib.types.package;default = [ pkgs.emacs pkgs.nodejs pkgs.gnutar ];};activationLogPath = lib.mkOption {type = lib.types.str;default = "${config.xdg.stateHome}/emacs/eask-activation.log";};refreshGeneratedInit = lib.mkOption {type = lib.types.bool;default = true;description = "Remove generated init/early-init under ~/.emacs.d/<emacs-version>/ and regenerate via `eask -c emacs --batch` during activation.";};};config = lib.mkIf cfg.enable {home.packages = [ emacsWrapper eask ];home.file."${easkFilePath}".source = cfg.easkFileSource;home.activation.easkInstallDeps =lib.mkIf cfg.installDevDeps(lib.hm.dag.entryAfter [ "linkGeneration" ] ''EMACSDIR=${lib.escapeShellArg emacsDir}export PATH=${lib.escapeShellArg (lib.makeBinPath [ emacs ])}:"$PATH"export PATH=${lib.escapeShellArg easkRuntimePath}:"$PATH"cd ${emacsDir}echo "[eask] running: eask install-deps ${lib.escapeShellArgs cfg.installDepsArgs}"${lib.escapeShellArg "${eask}/bin/eask"} install-deps ${lib.escapeShellArgs cfg.installDepsArgs}if ${lib.boolToString cfg.refreshGeneratedInit}; thenEMACS_VER="$(${lib.escapeShellArg "${emacs}/bin/emacs"} --batch --eval '(princ emacs-version)')"GEN_DIR="$EMACSDIR/.eask/$EMACS_VER"echo "[eask] emacs-version=$EMACS_VER gen-dir=$GEN_DIR"# rm -f "$GEN_DIR/init.el" "$GEN_DIR/early-init.el" || trueecho "[eask] regenerating generated init via: eask emacs --batch"${lib.escapeShellArg "${eask}/bin/eask"} emacs --batch --eval '(princ user-init-file)'echofiecho "[eask] done"'');};}
programs.emacsEask = {enable = true;emacsDir = "${config.home.homeDirectory}/.emacs.d";easkFileSource = ./emacs/Eask;installDepsArgs = [ "--dev" ];};home.file."${config.home.homeDirectory}/.emacs.d/early-init.el".source = ./emacs/early-init.el;home.file."${config.home.homeDirectory}/.emacs.d/init.el".source = ./emacs/init.el;