Make Emacs flake standalone
This commit is contained in:
parent
bad1727674
commit
bbd082947e
7 changed files with 293 additions and 126 deletions
|
|
@ -1,125 +1,17 @@
|
|||
{ config, pkgs, lib, ... }:
|
||||
{ self }:
|
||||
{ pkgs, lib, ... }:
|
||||
let
|
||||
treeSitterLibraryExtension =
|
||||
if pkgs.stdenv.hostPlatform.isDarwin then "dylib" else "so";
|
||||
|
||||
treeSitterGrammars = {
|
||||
swift = pkgs.tree-sitter-grammars.tree-sitter-swift;
|
||||
python = pkgs.tree-sitter-grammars.tree-sitter-python;
|
||||
typescript = pkgs.tree-sitter-grammars.tree-sitter-typescript;
|
||||
tsx = pkgs.tree-sitter-grammars.tree-sitter-tsx;
|
||||
javascript = pkgs.tree-sitter-grammars.tree-sitter-javascript;
|
||||
json = pkgs.tree-sitter-grammars.tree-sitter-json;
|
||||
};
|
||||
emacs = self.packages.${pkgs.stdenv.hostPlatform.system}.default;
|
||||
in
|
||||
{
|
||||
home.packages = with pkgs; [
|
||||
enchant
|
||||
hunspell
|
||||
hunspellDicts.de_DE
|
||||
hunspellDicts.en_US
|
||||
];
|
||||
home.packages = [ emacs ];
|
||||
|
||||
home.file =
|
||||
(lib.mapAttrs'
|
||||
(language: grammar:
|
||||
lib.nameValuePair
|
||||
".emacs.d/tree-sitter/libtree-sitter-${language}.${treeSitterLibraryExtension}"
|
||||
{ source = "${grammar}/parser"; })
|
||||
treeSitterGrammars)
|
||||
// {
|
||||
".emacs.d/early-init.el".source = ./config/early-init.el;
|
||||
".emacs.d/snippets".source = ./config/snippets;
|
||||
};
|
||||
|
||||
programs.emacs = {
|
||||
enable = true;
|
||||
extraConfig = builtins.readFile ./config/init.el +
|
||||
builtins.readFile ./config/lisp/utils.el;
|
||||
extraPackages = epkgs:
|
||||
let
|
||||
myEpkgs = epkgs.overrideScope (import ./pkgs { inherit pkgs; });
|
||||
in
|
||||
with myEpkgs; [
|
||||
agent-shell
|
||||
apheleia
|
||||
avy
|
||||
cape
|
||||
catppuccin-theme
|
||||
cider
|
||||
clojure-mode
|
||||
consult
|
||||
consult-denote
|
||||
copilot
|
||||
corfu
|
||||
denote
|
||||
diff-hl
|
||||
dockerfile-mode
|
||||
ef-themes
|
||||
eglot
|
||||
envrc
|
||||
exec-path-from-shell
|
||||
flycheck
|
||||
flycheck-clj-kondo
|
||||
flycheck-swiftlint
|
||||
flymake-collection
|
||||
git-timemachine
|
||||
graphql-mode
|
||||
helpful
|
||||
htmlize
|
||||
jinx
|
||||
js2-mode
|
||||
json-mode
|
||||
ledger-mode
|
||||
ligature
|
||||
markdown-mode
|
||||
minions
|
||||
multiple-cursors
|
||||
nerd-icons
|
||||
nerd-icons-completion
|
||||
nerd-icons-corfu
|
||||
nerd-icons-dired
|
||||
nerd-icons-ibuffer
|
||||
ob-restclient
|
||||
ob-swift
|
||||
olivetti
|
||||
orderless
|
||||
org
|
||||
org-modern
|
||||
ox-gfm
|
||||
ox-reveal
|
||||
pulsar
|
||||
rainbow-delimiters
|
||||
rainbow-mode
|
||||
restclient
|
||||
smartparens
|
||||
swift-mode
|
||||
swift-ts-mode
|
||||
super-save
|
||||
terraform-mode
|
||||
treesit-auto
|
||||
ob-typescript
|
||||
yaml-mode
|
||||
vterm
|
||||
fontaine
|
||||
magit
|
||||
magit-todos
|
||||
marginalia
|
||||
modus-themes
|
||||
nix-mode
|
||||
vertico
|
||||
web-mode
|
||||
winpulse
|
||||
yasnippet
|
||||
];
|
||||
};
|
||||
|
||||
launchd.agents.emacs-server = {
|
||||
launchd.agents.emacs-server = lib.mkIf pkgs.stdenv.hostPlatform.isDarwin {
|
||||
enable = true;
|
||||
config = {
|
||||
KeepAlive = true;
|
||||
ProgramArguments = [
|
||||
"${config.programs.emacs.finalPackage}/bin/emacs"
|
||||
"${emacs}/bin/emacs"
|
||||
"--fg-daemon"
|
||||
];
|
||||
RunAtLoad = true;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue