Move Emacs init.el and templates back to own repo, keep packages managed by nix

Restore sync-emacs script but without make step, include cleaning up
old Emacs config
This commit is contained in:
Evie Litherland-Smith 2024-12-19 10:45:12 +00:00
parent 63fcc689bc
commit 86938499ad
7 changed files with 70 additions and 1465 deletions

View file

@ -12,22 +12,12 @@
../texlive/default.nix ../texlive/default.nix
../programming/default.nix ../programming/default.nix
]; ];
home.file = {
".emacs.d/templates".source = ./templates;
".emacs.d/early-init.el".text = ''
(setopt use-package-check-before-init t
use-package-enable-imenu-support t
base16-theme-distinct-fringe-background t
base16-theme-highlight-mode-line 'contrast)
'';
};
services.emacs = { services.emacs = {
enable = lib.mkDefault true; enable = lib.mkDefault true;
package = config.programs.emacs.finalPackage; package = config.programs.emacs.finalPackage;
defaultEditor = true; defaultEditor = true;
client.enable = true; client.enable = true;
socketActivation.enable = false; socketActivation.enable = true;
startWithUserSession = "graphical";
}; };
programs.emacs = { programs.emacs = {
enable = true; enable = true;
@ -35,56 +25,13 @@
withImageMagick = true; withImageMagick = true;
withPgtk = true; withPgtk = true;
}; };
extraConfig = builtins.readFile ./init.el; extraConfig = ''
extraPackages = (setq use-package-check-before-init t
epkgs: with epkgs; [ use-package-enable-imenu-support t
# EViL Mode base16-theme-distinct-fringe-background t
evil base16-theme-highlight-mode-line 'contrast)
# UI and Appearance '';
delight extraPackages = epkgs: import ./packages.nix { inherit epkgs; };
nerd-icons
nerd-icons-dired
nerd-icons-ibuffer
nerd-icons-corfu
# Email and Calendar
khalel
mu4e
# Other (TODO sort)
diff-hl
org-roam
org-journal
org-noter
citar
vertico
marginalia
orderless
corfu
corfu-terminal
cape
consult
consult-eglot
tempel
tempel-collection
rainbow-delimiters
envrc
treesit-grammars.with-all-grammars
treesit-auto
apheleia
flymake-shellcheck
flymake-yamllint
flymake-clippy
flymake-eslint
magit
forge
nix-mode
lua-mode
python-docstring
python-pytest
auctex
markdown-mode
pandoc-mode
scad-mode
];
}; };
home.packages = with pkgs; [ home.packages = with pkgs; [
# External requirements # External requirements

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,50 @@
{ epkgs }:
with epkgs;
[
# EViL Mode
evil
# UI and Appearance
delight
nerd-icons
nerd-icons-dired
nerd-icons-ibuffer
nerd-icons-corfu
# Email and Calendar
khalel
mu4e
# Other (TODO sort)
diff-hl
org-roam
org-journal
org-noter
citar
vertico
marginalia
orderless
corfu
corfu-terminal
cape
consult
consult-eglot
tempel
tempel-collection
rainbow-delimiters
envrc
treesit-grammars.with-all-grammars
treesit-auto
apheleia
flymake-shellcheck
flymake-yamllint
flymake-clippy
flymake-eslint
magit
forge
nix-mode
lua-mode
python-docstring
python-pytest
auctex
markdown-mode
pandoc-mode
scad-mode
]

View file

@ -1,16 +0,0 @@
nix-mode
(fhsenv "let" n
> "pkgs = import " (p "<nixpkgs>") " { };" n
> "fhs = pkgs.buildFHSUserEnv {" n
> "name = \"" (p "env") "\";" n
> "targetPkgs = _: [ " q " ];" n
> "profile = \"\";" n
> "};" n
"in" n
> "fhs.env")
;; Local Variables:
;; mode: lisp-data
;; outline-regexp: "[a-z]"
;; End:

View file

@ -2,6 +2,7 @@
{ {
home.packages = [ home.packages = [
(pkgs.writeShellScriptBin "sync-git" (builtins.readFile ./shell/sync-git.sh)) (pkgs.writeShellScriptBin "sync-git" (builtins.readFile ./shell/sync-git.sh))
(pkgs.writeShellScriptBin "sync-emacs" (builtins.readFile ./shell/sync-emacs.sh))
(pkgs.writeShellScriptBin "ensure-pass" (builtins.readFile ./shell/ensure-pass.sh)) (pkgs.writeShellScriptBin "ensure-pass" (builtins.readFile ./shell/ensure-pass.sh))
(pkgs.writeShellScriptBin "clean-config" (builtins.readFile ./shell/clean-config.sh)) (pkgs.writeShellScriptBin "clean-config" (builtins.readFile ./shell/clean-config.sh))
(pkgs.writeShellScriptBin "rsync-local-config" (builtins.readFile ./shell/rsync-local-config.sh)) (pkgs.writeShellScriptBin "rsync-local-config" (builtins.readFile ./shell/rsync-local-config.sh))

View file

@ -0,0 +1,10 @@
# Clone ~/.config/emacs/ if it doesn't exist
EMACS_DIR="${XDG_CONFIG_HOME:-$HOME/.config}/emacs"
if [ ! -d "$EMACS_DIR" ]; then
git -C "$EMACS_DIR" pull --ff --ff-only
else
git clone "https://git.xenia.me.uk/pixelifytica/emacs.git" "$EMACS_DIR"
fi
# Cleanup legacy Emacs config file/directory
[ -f "$HOME/.emacs" ] && rm "$HOME/.emacs"
[ -f "$HOME/.emacs.d" ] && rm -r "$HOME/.emacs.d"

View file

@ -13,7 +13,7 @@
./cava.nix ./cava.nix
]; ];
home.shellAliases = { home.shellAliases = {
sync-all = "sync-git; vdirsyncer sync; mbsync -a"; sync-all = "sync-emacs; sync-git; vdirsyncer sync; mbsync -a";
sync-and-shutdown = "sync-all && shutdown now"; sync-and-shutdown = "sync-all && shutdown now";
protonup = "sudo wg-quick up protonvpn && sudo wg"; protonup = "sudo wg-quick up protonvpn && sudo wg";
protondown = "sudo wg-quick down protonvpn"; protondown = "sudo wg-quick down protonvpn";