2024-07-03 07:15:39 +01:00
|
|
|
{
|
|
|
|
config,
|
|
|
|
pkgs,
|
|
|
|
fonts,
|
|
|
|
...
|
|
|
|
}: {
|
2024-07-15 06:58:00 +01:00
|
|
|
imports = [../shell/default.nix];
|
2024-07-03 07:15:39 +01:00
|
|
|
services.emacs = {
|
|
|
|
enable = true;
|
|
|
|
package = config.programs.emacs.finalPackage;
|
|
|
|
defaultEditor = true;
|
|
|
|
client.enable = true;
|
|
|
|
socketActivation.enable = true;
|
|
|
|
startWithUserSession = false;
|
|
|
|
};
|
|
|
|
programs.emacs = {
|
|
|
|
# Clone emacs config from https://git.xenia.me.uk/pixelifytica/emacs.git
|
|
|
|
# git clone https://git.xenia.me.uk/pixelifytica/emacs.git ~/.emacs.d
|
|
|
|
enable = true;
|
|
|
|
package = pkgs.emacs29-pgtk;
|
|
|
|
extraConfig = let
|
|
|
|
fixed-font-family = "${fonts.monospace.name}";
|
|
|
|
variable-font-family = "${fonts.sansSerif.name}";
|
|
|
|
font-height = builtins.toString (builtins.floor (builtins.mul fonts.sizes.applications 10));
|
|
|
|
custom-theme-name = "nix";
|
|
|
|
custom-theme = pkgs.writeTextFile {
|
|
|
|
name = "custom-emacs-theme";
|
|
|
|
destination = "/${custom-theme-name}-theme.el";
|
|
|
|
text = ''
|
|
|
|
(deftheme ${custom-theme-name}
|
|
|
|
"Use Nix customised fonts for main faces")
|
|
|
|
|
|
|
|
(custom-theme-set-variables
|
|
|
|
'${custom-theme-name}
|
|
|
|
'(menu-bar-mode nil))
|
|
|
|
|
|
|
|
(custom-theme-set-faces
|
|
|
|
'${custom-theme-name}
|
|
|
|
'(default ((t (:family "${fixed-font-family}" :height ${font-height}))))
|
|
|
|
'(fixed-pitch ((t (:family "${fixed-font-family}"))))
|
|
|
|
'(fixed-pitch-serif ((t (:family "${fixed-font-family}"))))
|
|
|
|
'(variable-pitch ((t (:family "${variable-font-family}")))))
|
|
|
|
|
|
|
|
(provide-theme '${custom-theme-name})
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
custom-theme-hash = builtins.hashFile "sha256" "${custom-theme}/${custom-theme-name}-theme.el";
|
|
|
|
in ''
|
|
|
|
(add-to-list 'custom-theme-load-path "${custom-theme}")
|
|
|
|
(add-to-list 'custom-safe-themes "${custom-theme-hash}")
|
|
|
|
(load-theme '${custom-theme-name})
|
|
|
|
'';
|
2024-07-05 08:07:30 +01:00
|
|
|
extraPackages = epkgs:
|
2024-07-16 07:31:51 +01:00
|
|
|
with epkgs;
|
|
|
|
[
|
|
|
|
# Tree-sitter grammars, not a real Emacs package
|
|
|
|
treesit-grammars.with-all-grammars
|
|
|
|
# Maildir utils with linked Emacs package
|
|
|
|
mu4e
|
|
|
|
]
|
|
|
|
++ (import ./emacs-packages.nix epkgs);
|
2024-07-03 07:15:39 +01:00
|
|
|
};
|
|
|
|
home.packages = with pkgs; [
|
|
|
|
# Emacs requirements
|
|
|
|
imagemagick
|
|
|
|
languagetool
|
|
|
|
wordnet
|
|
|
|
graphviz # For org-roam graph
|
|
|
|
mp3info # For EMMS
|
|
|
|
|
|
|
|
# Language-specific requirements
|
|
|
|
sqlite
|
|
|
|
pandoc
|
|
|
|
ghostscript
|
|
|
|
poppler_utils
|
|
|
|
|
|
|
|
# Customised LaTeX install
|
|
|
|
(texlive.combine
|
|
|
|
{inherit (pkgs.texlive) scheme-medium dvisvgm dvipng wrapfig amsmath ulem hyperref capt-of;})
|
|
|
|
python3Packages.pygments
|
|
|
|
|
|
|
|
# Development tools
|
|
|
|
## Code screenshots
|
|
|
|
silicon
|
|
|
|
|
|
|
|
## Linters
|
|
|
|
shellcheck
|
|
|
|
yamllint
|
|
|
|
nodePackages.eslint
|
|
|
|
|
|
|
|
## Formatters
|
|
|
|
alejandra
|
|
|
|
shfmt
|
|
|
|
ruff
|
|
|
|
black
|
|
|
|
isort
|
|
|
|
stylua
|
|
|
|
nodePackages.prettier
|
|
|
|
|
|
|
|
## Language servers
|
|
|
|
nil # Nix lsp
|
|
|
|
lua-language-server
|
|
|
|
nodePackages.pyright
|
|
|
|
nodePackages.typescript-language-server
|
2024-07-15 06:58:00 +01:00
|
|
|
|
|
|
|
## Interpreters
|
2024-07-23 19:40:57 +01:00
|
|
|
(python3.withPackages
|
|
|
|
(ps: with ps; [tkinter numpy scipy xarray matplotlib]))
|
2024-07-15 06:58:00 +01:00
|
|
|
(luajit.withPackages
|
|
|
|
(ps: [(ps.callPackage ./luarocks/scilua.nix {})]))
|
2024-07-03 07:15:39 +01:00
|
|
|
];
|
2024-07-15 06:58:00 +01:00
|
|
|
xdg.configFile = {
|
|
|
|
"ruff/pyproject.toml".source = ./ruff.toml;
|
|
|
|
"pypoetry/config.toml".source = ./pypoetry.toml;
|
|
|
|
};
|
2024-07-03 07:15:39 +01:00
|
|
|
}
|